summaryrefslogtreecommitdiff
path: root/indra/newview/llxmlrpctransaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llxmlrpctransaction.cpp')
-rw-r--r--indra/newview/llxmlrpctransaction.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 257884d921..0da70d398b 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -305,20 +305,18 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
{
mCurlRequest = new LLCurlEasyRequest();
}
- mErrorCert = NULL;
-
- if (gSavedSettings.getBOOL("BrowserProxyEnabled"))
+ if(!mCurlRequest->isValid())
{
- mProxyAddress = gSavedSettings.getString("BrowserProxyAddress");
- S32 port = gSavedSettings.getS32 ( "BrowserProxyPort" );
+ llwarns << "mCurlRequest is invalid." << llendl ;
- // tell curl about the settings
- mCurlRequest->setoptString(CURLOPT_PROXY, mProxyAddress);
- mCurlRequest->setopt(CURLOPT_PROXYPORT, port);
- mCurlRequest->setopt(CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+ delete mCurlRequest ;
+ mCurlRequest = NULL ;
+ return ;
}
-// mCurlRequest->setopt(CURLOPT_VERBOSE, 1); // usefull for debugging
+ mErrorCert = NULL;
+
+// mCurlRequest->setopt(CURLOPT_VERBOSE, 1); // useful for debugging
mCurlRequest->setopt(CURLOPT_NOSIGNAL, 1);
mCurlRequest->setWriteCallback(&curlDownloadCallback, (void*)this);
BOOL vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert");
@@ -368,10 +366,20 @@ LLXMLRPCTransaction::Impl::~Impl()
}
delete mCurlRequest;
+ mCurlRequest = NULL ;
}
bool LLXMLRPCTransaction::Impl::process()
{
+ if(!mCurlRequest || !mCurlRequest->isValid())
+ {
+ llwarns << "transaction failed." << llendl ;
+
+ delete mCurlRequest ;
+ mCurlRequest = NULL ;
+ return true ; //failed, quit.
+ }
+
switch(mStatus)
{
case LLXMLRPCTransaction::StatusComplete:
@@ -393,16 +401,10 @@ bool LLXMLRPCTransaction::Impl::process()
// continue onward
}
}
-
- const F32 MAX_PROCESSING_TIME = 0.05f;
- LLTimer timer;
-
- while (mCurlRequest->perform() > 0)
+
+ if(!mCurlRequest->wait())
{
- if (timer.getElapsedTimeF32() >= MAX_PROCESSING_TIME)
- {
- return false;
- }
+ return false ;
}
while(1)