diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcorehttp/_httplibcurl.cpp | 43 | ||||
-rwxr-xr-x | indra/llcorehttp/_httpoperation.cpp | 3 | ||||
-rwxr-xr-x | indra/llcorehttp/_httpoprequest.cpp | 6 | ||||
-rwxr-xr-x | indra/llcorehttp/_httppolicy.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 2 | ||||
-rwxr-xr-x | indra/newview/llappcorehttp.cpp | 4 |
6 files changed, 44 insertions, 16 deletions
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index d918c2ee1b..c25e01a318 100755 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -301,7 +301,14 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode { HttpHandle ophandle(NULL); - curl_easy_getinfo(handle, CURLINFO_PRIVATE, &ophandle); + CURLcode ccode(CURLE_OK); + + ccode = curl_easy_getinfo(handle, CURLINFO_PRIVATE, &ophandle); + if (ccode) + { + LL_WARNS(LOG_CORE) << "libcurl error: " << ccode << " Unable to retrieve operation handle from CURL handle" << LL_ENDL; + return false; + } HttpOpRequest::ptr_t op(HttpOpRequest::fromHandle<HttpOpRequest>(ophandle)); if (!op) @@ -343,22 +350,36 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode if (handle) { - curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &http_status); - if (http_status >= 100 && http_status <= 999) + ccode = curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &http_status); + if (ccode == CURLE_OK) { - char * cont_type(NULL); - curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &cont_type); - if (cont_type) + if (http_status >= 100 && http_status <= 999) + { + char * cont_type(NULL); + ccode = curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &cont_type); + if (ccode == CURLE_OK) + { + if (cont_type) + { + op->mReplyConType = cont_type; + } + } + else + { + LL_WARNS(LOG_CORE) << "CURL error:" << ccode << " Attempting to get content type." << LL_ENDL; + } + op->mStatus = HttpStatus(http_status); + } + else { - op->mReplyConType = cont_type; + LL_WARNS(LOG_CORE) << "Invalid HTTP response code (" + << http_status << ") received from server." + << LL_ENDL; + op->mStatus = HttpStatus(HttpStatus::LLCORE, HE_INVALID_HTTP_STATUS); } - op->mStatus = HttpStatus(http_status); } else { - LL_WARNS(LOG_CORE) << "Invalid HTTP response code (" - << http_status << ") received from server." - << LL_ENDL; op->mStatus = HttpStatus(HttpStatus::LLCORE, HE_INVALID_HTTP_STATUS); } } diff --git a/indra/llcorehttp/_httpoperation.cpp b/indra/llcorehttp/_httpoperation.cpp index 333f20d281..3fc4e28910 100755 --- a/indra/llcorehttp/_httpoperation.cpp +++ b/indra/llcorehttp/_httpoperation.cpp @@ -179,6 +179,9 @@ HttpOperation::ptr_t HttpOperation::findByHandle(HttpHandle handle) { wptr_t weak; + if (!handle) + return ptr_t(); + { LLCoreInt::HttpScopedLock lock(mOpMutex); diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 557f6207b5..db57869a1b 100755 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -750,7 +750,11 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) xfer_timeout *= 2L; } // *DEBUG: Enable following override for timeout handling and "[curl:bugs] #1420" tests - // xfer_timeout = 1L; + //if (cpolicy.mPipelining) + //{ + // xfer_timeout = 1L; + // timeout = 1L; + //} code = curl_easy_setopt(mCurlHandle, CURLOPT_TIMEOUT, xfer_timeout); check_curl_easy_code(code, CURLOPT_TIMEOUT); code = curl_easy_setopt(mCurlHandle, CURLOPT_CONNECTTIMEOUT, timeout); diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index fd78a5dadc..b2709b53ec 100755 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -416,7 +416,7 @@ bool HttpPolicy::stageAfterCompletion(const HttpOpRequest::ptr_t &op) #if 0 if (op->mStatus == HttpStatus(HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT)) { - LL_WARNS(LOG_CORE) << "HTTP request " << static_cast<HttpHandle>(op) + LL_WARNS(LOG_CORE) << "HTTP request " << op->getHandle() << " timed out." << LL_ENDL; } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 46fd9a27e3..d5549013fa 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4557,7 +4557,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>HttpRangeRequestsDisable</key> <map> diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index c13c4f982a..7dee309a62 100755 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -125,7 +125,7 @@ LLAppCoreHttp::LLAppCoreHttp() mStopHandle(LLCORE_HTTP_HANDLE_INVALID), mStopRequested(0.0), mStopped(false), - mPipelined(false) + mPipelined(true) {} @@ -359,7 +359,7 @@ void LLAppCoreHttp::refreshSettings(bool initial) static const std::string http_pipelining("HttpPipelining"); if (gSavedSettings.controlExists(http_pipelining)) { - // Default to false (in ctor) if absent. + // Default to true (in ctor) if absent. bool pipelined(gSavedSettings.getBOOL(http_pipelining)); if (pipelined != mPipelined) { |