diff options
author | Kelly Washington <kelly@lindenlab.com> | 2007-03-16 17:29:45 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2007-03-16 17:29:45 +0000 |
commit | 1ada34fc0c5dc20bffba231ef513b569dbec32ea (patch) | |
tree | 289bbf4de3978453f5214c97cf514785a90da015 /indra/llmessage/llhttpclient.cpp | |
parent | 9d3309f6847a7406b2094201174cfa718cd60aa9 (diff) |
merge -r58842:59035 branches/loadstone-names to release
Diffstat (limited to 'indra/llmessage/llhttpclient.cpp')
-rw-r--r-- | indra/llmessage/llhttpclient.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index f93a12b274..0929f93dc1 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -265,11 +265,19 @@ public: LLSD asLLSD() { LLSD content; + + if (mBuffer.empty()) return content; + std::istringstream istr(mBuffer); LLSDSerialize::fromXML(content, istr); return content; } + std::string asString() + { + return mBuffer; + } + private: std::string mBuffer; }; @@ -298,15 +306,20 @@ LLSD LLHTTPClient::blockingGet(const std::string& url) S32 http_status = 499; curl_easy_getinfo(curlp,CURLINFO_RESPONSE_CODE, &http_status); + response["status"] = http_status; + if (curl_success != 0 && http_status != 404) // We expect 404s, don't spam for them. { llwarns << "CURL ERROR: " << curl_error_buffer << llendl; + + response["body"] = http_buffer.asString(); + } + else + { + response["body"] = http_buffer.asLLSD(); } - response["status"] = http_status; - response["body"] = http_buffer.asLLSD(); - curl_easy_cleanup(curlp); return response; @@ -375,4 +388,3 @@ namespace boost } } }; - |