diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2012-06-01 14:07:34 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2012-06-01 14:07:34 -0400 |
commit | b8edacd0bb4feacc3ac1d61421e600c75ab87f7c (patch) | |
tree | 8f0e359445e324e4694e79526e443d5e6c90fab4 /indra/llcorehttp/httpcommon.cpp | |
parent | 8fc350125c671baeae6b7f8b1814251009f4f50a (diff) |
Major steps towards implementing the policy component.
Identified and reacted to the priority inversion problem we
have in texturefetch. Includes the introduction of a priority_queue
for the requests that are ready. Start some parameterization in
anticipation of having policy_class everywhere. Removed _assert.h
which isn't really needed in indra codebase. Implemented async
setPriority request (which I hope I can get rid of eventually along
with all priorities in this library). Converted to using unsigned
int for priority rather than float. Implemented POST and did
groundwork for PUT.
Diffstat (limited to 'indra/llcorehttp/httpcommon.cpp')
-rw-r--r-- | indra/llcorehttp/httpcommon.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index b5872606b8..273acae132 100644 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -28,6 +28,7 @@ #include <curl/curl.h> #include <string> +#include <sstream> namespace LLCore @@ -46,6 +47,16 @@ HttpStatus::operator unsigned long() const } +std::string HttpStatus::toHex() const +{ + std::ostringstream result; + result.width(8); + result.fill('0'); + result << std::hex << operator unsigned long(); + return result.str(); + +} + std::string HttpStatus::toString() const { static const char * llcore_errors[] = @@ -54,7 +65,8 @@ std::string HttpStatus::toString() const "HTTP error reply status", "Services shutting down", "Operation canceled", - "Invalid Content-Range header encountered" + "Invalid Content-Range header encountered", + "Request handle not found" }; static const int llcore_errors_count(sizeof(llcore_errors) / sizeof(llcore_errors[0])); @@ -131,6 +143,7 @@ std::string HttpStatus::toString() const default: if (isHttpStatus()) { + // Binary search for the error code and string int bottom(0), top(http_errors_count); while (true) { |