Skip to content
Snippets Groups Projects
Commit cc3f90a8 authored by Xiaohong Bao's avatar Xiaohong Bao
Browse files
parents 361efbc0 1316f331
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,7 @@ std::string LLCurl::sCAFile; ...@@ -91,6 +91,7 @@ std::string LLCurl::sCAFile;
LLCurlThread* LLCurl::sCurlThread = NULL ; LLCurlThread* LLCurl::sCurlThread = NULL ;
LLMutex* LLCurl::sHandleMutexp = NULL ; LLMutex* LLCurl::sHandleMutexp = NULL ;
S32 LLCurl::sTotalHandles = 0 ; S32 LLCurl::sTotalHandles = 0 ;
bool LLCurl::sNotQuitting = true;
void check_curl_code(CURLcode code) void check_curl_code(CURLcode code)
{ {
...@@ -319,6 +320,14 @@ LLCurl::Easy::~Easy() ...@@ -319,6 +320,14 @@ LLCurl::Easy::~Easy()
--gCurlEasyCount; --gCurlEasyCount;
curl_slist_free_all(mHeaders); curl_slist_free_all(mHeaders);
for_each(mStrings.begin(), mStrings.end(), DeletePointerArray()); for_each(mStrings.begin(), mStrings.end(), DeletePointerArray());
if (mResponder && LLCurl::sNotQuitting) //aborted
{
std::string reason("Request timeout, aborted.") ;
mResponder->completedRaw(408, //HTTP_REQUEST_TIME_OUT, timeout, abort
reason, mChannels, mOutput);
}
mResponder = NULL;
} }
void LLCurl::Easy::resetState() void LLCurl::Easy::resetState()
...@@ -1462,6 +1471,8 @@ void LLCurl::initClass(bool multi_threaded) ...@@ -1462,6 +1471,8 @@ void LLCurl::initClass(bool multi_threaded)
void LLCurl::cleanupClass() void LLCurl::cleanupClass()
{ {
sNotQuitting = false; //set quitting
//shut down curl thread //shut down curl thread
while(1) while(1)
{ {
......
...@@ -197,6 +197,8 @@ class LLCurl ...@@ -197,6 +197,8 @@ class LLCurl
static LLMutex* sHandleMutexp ; static LLMutex* sHandleMutexp ;
static S32 sTotalHandles ; static S32 sTotalHandles ;
public:
static bool sNotQuitting;
}; };
class LLCurl::Easy class LLCurl::Easy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment