summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/httpcommon.cpp
diff options
context:
space:
mode:
authorJames Johnson <jj@lindenlab.com>2014-02-26 10:16:07 -0800
committerJames Johnson <jj@lindenlab.com>2014-02-26 10:16:07 -0800
commit556506278ab870f5ac190d25a991511b74074325 (patch)
tree110e83685b598e30502e7abd9c6f31cfa6b3a507 /indra/llcorehttp/httpcommon.cpp
parent0abdab7848b6fb02c2600e74774426acc6bf5ef6 (diff)
parentde8fea13627cc5978b8a6135802a52864a11c39a (diff)
Merged lindenlab/viewer-release into default
Diffstat (limited to 'indra/llcorehttp/httpcommon.cpp')
-rwxr-xr-xindra/llcorehttp/httpcommon.cpp42
1 files changed, 40 insertions, 2 deletions
diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp
index 0738760763..c2f15155ac 100755
--- a/indra/llcorehttp/httpcommon.cpp
+++ b/indra/llcorehttp/httpcommon.cpp
@@ -70,7 +70,8 @@ std::string HttpStatus::toString() const
"Invalid datatype for argument or option",
"Option has not been explicitly set",
"Option is not dynamic and must be set early",
- "Invalid HTTP status code received from server"
+ "Invalid HTTP status code received from server",
+ "Could not allocate required resource"
};
static const int llcore_errors_count(sizeof(llcore_errors) / sizeof(llcore_errors[0]));
@@ -177,6 +178,44 @@ std::string HttpStatus::toString() const
}
+std::string HttpStatus::toTerseString() const
+{
+ std::ostringstream result;
+
+ unsigned int error_value((unsigned short) mStatus);
+
+ switch (mType)
+ {
+ case EXT_CURL_EASY:
+ result << "Easy_";
+ break;
+
+ case EXT_CURL_MULTI:
+ result << "Multi_";
+ break;
+
+ case LLCORE:
+ result << "Core_";
+ break;
+
+ default:
+ if (isHttpStatus())
+ {
+ result << "Http_";
+ error_value = mType;
+ }
+ else
+ {
+ result << "Unknown_";
+ }
+ break;
+ }
+
+ result << error_value;
+ return result.str();
+}
+
+
// Pass true on statuses that might actually be cleared by a
// retry. Library failures, calling problems, etc. aren't
// going to be fixed by squirting bits all over the Net.
@@ -206,6 +245,5 @@ bool HttpStatus::isRetryable() const
*this == inv_cont_range); // Short data read disagrees with content-range
}
-
} // end namespace LLCore