summaryrefslogtreecommitdiff
path: root/indra/llcorehttp
diff options
context:
space:
mode:
authorRider Linden <none@none>2015-03-25 11:31:11 -0700
committerRider Linden <none@none>2015-03-25 11:31:11 -0700
commite140118fc41b79e403b299cabe1653af1971e87a (patch)
treea67ab5d98aaec4e6be50ddf67c537a799fcc8d15 /indra/llcorehttp
parent3c46c6bcf2afcac5e0d6f435480cbee5c3136f63 (diff)
Replace appearance responder with new LLCore Appearance Handler.
Prep for some slight cleanup of the code. Add AP_AVATAR Policy
Diffstat (limited to 'indra/llcorehttp')
-rwxr-xr-xindra/llcorehttp/httpcommon.cpp4
-rwxr-xr-xindra/llcorehttp/httpcommon.h13
2 files changed, 14 insertions, 3 deletions
diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp
index d923dfa5d6..99238ea920 100755
--- a/indra/llcorehttp/httpcommon.cpp
+++ b/indra/llcorehttp/httpcommon.cpp
@@ -149,6 +149,10 @@ std::string HttpStatus::toString() const
default:
if (isHttpStatus())
{
+ // special handling for status 499 "Linden Catchall"
+ if ((getType() == 499) && (!getMessage().empty()))
+ return getMessage();
+
// Binary search for the error code and string
int bottom(0), top(http_errors_count);
while (true)
diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h
index e673d7b589..64075f5f20 100755
--- a/indra/llcorehttp/httpcommon.h
+++ b/indra/llcorehttp/httpcommon.h
@@ -286,6 +286,8 @@ enum HttpError
/// 5. Construct an HTTP 301 status code to be treated as success:
/// HttpStatus(301, HE_SUCCESS);
///
+/// 6. Construct a failed status of HTTP Status 499 with a custom error message
+/// HttpStatus(499, "Failed LLSD Response");
struct HttpStatus
{
@@ -307,6 +309,14 @@ struct HttpStatus
(http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR);
llassert(http_status >= 100 && http_status <= 999);
}
+
+ HttpStatus(int http_status, const std::string &message)
+ {
+ mDetails = new Details(http_status,
+ (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR);
+ llassert(http_status >= 100 && http_status <= 999);
+ mDetails->mMessage = message;
+ }
HttpStatus(const HttpStatus & rhs)
{
@@ -420,9 +430,6 @@ struct HttpStatus
return mDetails->mType;
}
- // TODO: There must be a better way to do this. Don't want to set these
- // values here since they increase the size of a structure that is already
- // being passed on the stack. Consider my options
/// Returns an optional error message if one has been set.
///
std::string getMessage() const