summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/httpcommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcorehttp/httpcommon.cpp')
-rwxr-xr-xindra/llcorehttp/httpcommon.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp
index 7907e958a4..99238ea920 100755
--- a/indra/llcorehttp/httpcommon.cpp
+++ b/indra/llcorehttp/httpcommon.cpp
@@ -42,7 +42,7 @@ HttpStatus::operator unsigned long() const
{
static const int shift(sizeof(unsigned long) * 4);
- unsigned long result(((unsigned long) mType) << shift | (unsigned long) (int) mStatus);
+ unsigned long result(((unsigned long)mDetails->mType) << shift | (unsigned long)(int)mDetails->mStatus);
return result;
}
@@ -131,30 +131,34 @@ std::string HttpStatus::toString() const
{
return std::string("");
}
- switch (mType)
+ switch (getType())
{
case EXT_CURL_EASY:
- return std::string(curl_easy_strerror(CURLcode(mStatus)));
+ return std::string(curl_easy_strerror(CURLcode(getStatus())));
case EXT_CURL_MULTI:
- return std::string(curl_multi_strerror(CURLMcode(mStatus)));
+ return std::string(curl_multi_strerror(CURLMcode(getStatus())));
case LLCORE:
- if (mStatus >= 0 && mStatus < llcore_errors_count)
+ if (getStatus() >= 0 && getStatus() < llcore_errors_count)
{
- return std::string(llcore_errors[mStatus]);
+ return std::string(llcore_errors[getStatus()]);
}
break;
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)
{
int at((bottom + top) / 2);
- if (mType == http_errors[at].mCode)
+ if (getType() == http_errors[at].mCode)
{
return std::string(http_errors[at].mText);
}
@@ -162,7 +166,7 @@ std::string HttpStatus::toString() const
{
break;
}
- else if (mType < http_errors[at].mCode)
+ else if (getType() < http_errors[at].mCode)
{
top = at;
}
@@ -182,9 +186,9 @@ std::string HttpStatus::toTerseString() const
{
std::ostringstream result;
- unsigned int error_value((unsigned short) mStatus);
+ unsigned int error_value((unsigned short)getStatus());
- switch (mType)
+ switch (getType())
{
case EXT_CURL_EASY:
result << "Easy_";
@@ -202,7 +206,7 @@ std::string HttpStatus::toTerseString() const
if (isHttpStatus())
{
result << "Http_";
- error_value = mType;
+ error_value = getType();
}
else
{
@@ -244,7 +248,7 @@ bool HttpStatus::isRetryable() const
// Disable the '*this == inv_status' test and look for 'Core_9'
// failures in log files.
- return ((isHttpStatus() && mType >= 499 && mType <= 599) || // Include special 499 in retryables
+ return ((isHttpStatus() && getType() >= 499 && getType() <= 599) || // Include special 499 in retryables
*this == cant_connect || // Connection reset/endpoint problems
*this == cant_res_proxy || // DNS problems
*this == cant_res_host || // DNS problems