summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/httpcommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcorehttp/httpcommon.h')
-rwxr-xr-xindra/llcorehttp/httpcommon.h13
1 files changed, 10 insertions, 3 deletions
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