diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2012-07-16 11:53:04 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2012-07-16 11:53:04 -0400 |
commit | d238341afaecedfe227141126c4c35dcde4a0671 (patch) | |
tree | b1c3140fdd357c67abbc75d09846ce7c21678b69 /indra/llcorehttp/_httplibcurl.cpp | |
parent | 5eb5dc6b27c57f1c3e77fc04b471614968620068 (diff) |
SH-3189 Remove/improve naive data structures
When releasing HTTP waiters, avoid unnecessary sort activity.
For Content-Type in responses, let libcurl do the work and removed
my parsing of headers. Drop Content-Encoding as libcurl will deal
with that. If anyone is interested, they can parse.
Diffstat (limited to 'indra/llcorehttp/_httplibcurl.cpp')
-rw-r--r-- | indra/llcorehttp/_httplibcurl.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index 3c69ae1c96..e031efbc91 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -280,7 +280,23 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode int http_status(HTTP_OK); curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &http_status); - op->mStatus = LLCore::HttpStatus(http_status); + if (http_status >= 100 && http_status <= 999) + { + char * cont_type(NULL); + curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &cont_type); + if (cont_type) + { + op->mReplyConType = cont_type; + } + op->mStatus = HttpStatus(http_status); + } + else + { + LL_WARNS("CoreHttp") << "Invalid HTTP response code (" + << http_status << ") received from server." + << LL_ENDL; + op->mStatus = HttpStatus(HttpStatus::LLCORE, HE_INVALID_HTTP_STATUS); + } } // Detach from multi and recycle handle |