summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2013-04-04 21:50:45 +0000
committerDon Kjer <don@lindenlab.com>2013-04-04 21:50:45 +0000
commitbeeefb45269f45ea717f58b30a0985951ae23c20 (patch)
tree34f48c7703588b64bb625984f77a74752997099f /indra/newview
parent7c37af37d4459425b3ab705156eeff316531bc81 (diff)
Renaming HTTP_HEADER_* into HTTP_IN_HEADER_* and HTTP_OUT_HEADER_* to make it more clear which header strings should be used for incoming vs outgoing situations.
Using constants for commonly used llhttpnode context strings.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llappearancemgr.cpp4
-rw-r--r--indra/newview/llfloaterabout.cpp3
-rw-r--r--indra/newview/llfloaterurlentry.cpp3
-rw-r--r--indra/newview/llmarketplacefunctions.cpp23
-rw-r--r--indra/newview/llmediadataclient.cpp4
-rwxr-xr-xindra/newview/llmeshrepository.cpp10
-rwxr-xr-xindra/newview/lltexturefetch.cpp6
-rwxr-xr-xindra/newview/lltranslate.cpp4
-rw-r--r--indra/newview/llviewerdisplayname.cpp2
-rw-r--r--indra/newview/llviewermedia.cpp34
-rw-r--r--indra/newview/llwebprofile.cpp11
-rw-r--r--indra/newview/llwebsharing.cpp69
-rw-r--r--indra/newview/llxmlrpctransaction.cpp2
13 files changed, 94 insertions, 81 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 43439bac5d..0b85f438bd 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3008,8 +3008,8 @@ public:
#if 0
// *TODO: Honor server Retry-After header.
// Status 503 may ask us to wait for a certain amount of time before retrying.
- if (!headers.has(HTTP_HEADER_RETRY_AFTER)
- || !getSecondsUntilRetryAfter(headers[HTTP_HEADER_RETRY_AFTER].asStringRef(), seconds_to_wait))
+ if (!headers.has(HTTP_IN_HEADER_RETRY_AFTER)
+ || !getSecondsUntilRetryAfter(headers[HTTP_IN_HEADER_RETRY_AFTER].asStringRef(), seconds_to_wait))
#endif
{
seconds_to_wait = mDelay;
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 63888ace11..801a24f472 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -474,8 +474,7 @@ void LLServerReleaseNotesURLFetcher::httpCompleted()
LLFloaterAbout* floater_about = LLFloaterReg::getTypedInstance<LLFloaterAbout>("sl_about");
if (floater_about)
{
- const bool check_lower = true;
- const std::string& location = getResponseHeader(HTTP_HEADER_LOCATION, check_lower);
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
if (location.empty())
{
LL_WARNS("ServerReleaseNotes") << "Missing Location header "
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index 0751c830d5..e26f1e9ea5 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -59,8 +59,7 @@ public:
private:
/* virtual */ void httpCompleted()
{
- const bool check_lower = true;
- const std::string& media_type = getResponseHeader(HTTP_HEADER_CONTENT_TYPE, check_lower);
+ const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE);
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index bea1d62b93..28e1df725a 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -167,8 +167,7 @@ namespace LLMarketplaceImport
protected:
/* virtual */ void httpCompleted()
{
- const bool check_lower = true;
- const std::string& set_cookie_string = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower);
+ const std::string& set_cookie_string = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
if (!set_cookie_string.empty())
{
@@ -278,10 +277,11 @@ namespace LLMarketplaceImport
// Make the headers for the post
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_ACCEPT] = "*/*";
- headers[HTTP_HEADER_COOKIE] = sMarketplaceCookie;
- headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML;
- headers[HTTP_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_COOKIE] = sMarketplaceCookie;
+ // *TODO: Why are we setting Content-Type for a GET request?
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
@@ -311,12 +311,11 @@ namespace LLMarketplaceImport
// Make the headers for the post
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_ACCEPT] = "*/*";
- headers[HTTP_HEADER_CONNECTION] = "Keep-Alive";
- headers[HTTP_HEADER_COOKIE] = sMarketplaceCookie;
- // *TODO: Should this be 'application/llsd+xml'?
- headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML;
- headers[HTTP_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_CONNECTION] = "Keep-Alive";
+ headers[HTTP_OUT_HEADER_COOKIE] = sMarketplaceCookie;
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp
index bc1aa087e5..691be13610 100644
--- a/indra/newview/llmediadataclient.cpp
+++ b/indra/newview/llmediadataclient.cpp
@@ -579,8 +579,8 @@ void LLMediaDataClient::Responder::httpFailure()
F32 retry_timeout;
#if 0
// *TODO: Honor server Retry-After header.
- if (!hasResponseHeader(HTTP_HEADER_RETRY_AFTER)
- || !getSecondsUntilRetryAfter(getResponseHeader(HTTP_HEADER_RETRY_AFTER), retry_timeout))
+ if (!hasResponseHeader(HTTP_IN_HEADER_RETRY_AFTER)
+ || !getSecondsUntilRetryAfter(getResponseHeader(HTTP_IN_HEADER_RETRY_AFTER), retry_timeout))
#endif
{
retry_timeout = mRequest->getRetryTimerDelay();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 1469dbc346..524467a37e 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -808,7 +808,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
//reading from VFS failed for whatever reason, fetch from sim
std::vector<std::string> headers;
- headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
+ headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
std::string http_url = constructUrl(mesh_id);
if (!http_url.empty())
@@ -890,7 +890,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
//reading from VFS failed for whatever reason, fetch from sim
std::vector<std::string> headers;
- headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
+ headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
std::string http_url = constructUrl(mesh_id);
if (!http_url.empty())
@@ -971,7 +971,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
//reading from VFS failed for whatever reason, fetch from sim
std::vector<std::string> headers;
- headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
+ headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
std::string http_url = constructUrl(mesh_id);
if (!http_url.empty())
@@ -1052,7 +1052,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c
//either cache entry doesn't exist or is corrupt, request header from simulator
bool retval = true ;
std::vector<std::string> headers;
- headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
+ headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
std::string http_url = constructUrl(mesh_params.getSculptID());
if (!http_url.empty())
@@ -1127,7 +1127,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
//reading from VFS failed for whatever reason, fetch from sim
std::vector<std::string> headers;
- headers.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
+ headers.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_OCTET_STREAM);
std::string http_url = constructUrl(mesh_id);
if (!http_url.empty())
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 9e9efa7ebd..cc6dc64626 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -2408,9 +2408,9 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
mHttpOptions = new LLCore::HttpOptions;
mHttpHeaders = new LLCore::HttpHeaders;
// *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ?
- mHttpHeaders->mHeaders.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C);
+ mHttpHeaders->mHeaders.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C);
mHttpMetricsHeaders = new LLCore::HttpHeaders;
- mHttpMetricsHeaders->mHeaders.push_back(HTTP_HEADER_CONTENT_TYPE + ": " + HTTP_CONTENT_LLSD_XML);
+ mHttpMetricsHeaders->mHeaders.push_back(HTTP_OUT_HEADER_CONTENT_TYPE + ": " + HTTP_CONTENT_LLSD_XML);
mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicyDefault();
}
@@ -4043,7 +4043,7 @@ void LLTextureFetchDebugger::init()
{
mHttpHeaders = new LLCore::HttpHeaders;
// *TODO: Should this be 'image/j2c' instead of 'image/x-j2c' ?
- mHttpHeaders->mHeaders.push_back(HTTP_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C);
+ mHttpHeaders->mHeaders.push_back(HTTP_OUT_HEADER_ACCEPT + ": " + HTTP_CONTENT_IMAGE_X_J2C);
}
}
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index b9840fa3e4..ae934d9f5a 100755
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -394,8 +394,8 @@ void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr
LLVersionInfo::getPatch(),
LLVersionInfo::getBuild());
- sHeader.insert(HTTP_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN);
- sHeader.insert(HTTP_HEADER_USER_AGENT, user_agent);
+ sHeader.insert(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN);
+ sHeader.insert(HTTP_OUT_HEADER_USER_AGENT, user_agent);
}
LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT);
diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp
index 5d94756da3..3f836efdd3 100644
--- a/indra/newview/llviewerdisplayname.cpp
+++ b/indra/newview/llviewerdisplayname.cpp
@@ -86,7 +86,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
// People API can return localized error messages. Indicate our
// language preference via header.
LLSD headers;
- headers[HTTP_HEADER_ACCEPT_LANGUAGE] = LLUI::getLanguage();
+ headers[HTTP_OUT_HEADER_ACCEPT_LANGUAGE] = LLUI::getLanguage();
// People API requires both the old and new value to change a variable.
// Our display name will be in cache before the viewer's UI is available
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 8c29a03176..2cec808f19 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -185,8 +185,7 @@ private:
llwarns << dumpResponse()
<< " [headers:" << getResponseHeaders() << "]" << llendl;
}
- const bool check_lower = true;
- const std::string& media_type = getResponseHeader(HTTP_HEADER_CONTENT_TYPE, check_lower);
+ const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE);
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
@@ -289,8 +288,7 @@ public:
// We don't care about the content of the response, only the Set-Cookie header.
LL_DEBUGS("MediaAuth") << dumpResponse()
<< " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
- const bool check_lower = true;
- const std::string& cookie = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower);
+ const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
// *TODO: What about bad status codes? Does this destroy previous cookies?
LLViewerMedia::openIDCookieResponse(cookie);
@@ -321,12 +319,10 @@ public:
LLSD stripped_content = getResponseHeaders();
// *TODO: Check that this works.
- stripped_content.erase(HTTP_HEADER_SET_COOKIE);
- stripped_content.erase("set-cookie");
+ stripped_content.erase(HTTP_IN_HEADER_SET_COOKIE);
LL_WARNS("MediaAuth") << stripped_content << LL_ENDL;
- const bool check_lower = true;
- const std::string& cookie = getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower);
+ const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
LL_DEBUGS("MediaAuth") << "cookie = " << cookie << LL_ENDL;
// *TODO: What about bad status codes? Does this destroy previous cookies?
@@ -1383,12 +1379,12 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom
LLSD LLViewerMedia::getHeaders()
{
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
// *TODO: Should this be 'application/llsd+xml' ?
// *TODO: Should this even be set at all? This header is only not overridden in 'GET' methods.
- headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML;
- headers[HTTP_HEADER_COOKIE] = sOpenIDCookie;
- headers[HTTP_HEADER_USER_AGENT] = getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML;
+ headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent();
return headers;
}
@@ -1429,9 +1425,9 @@ void LLViewerMedia::setOpenIDCookie()
// Do a web profile get so we can store the cookie
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_ACCEPT] = "*/*";
- headers[HTTP_HEADER_COOKIE] = sOpenIDCookie;
- headers[HTTP_HEADER_USER_AGENT] = getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent();
std::string profile_url = getProfileURL("");
LLURL raw_profile_url( profile_url.c_str() );
@@ -1461,9 +1457,9 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string
LLSD headers = LLSD::emptyMap();
// Keep LLHTTPClient from adding an "Accept: application/llsd+xml" header
- headers[HTTP_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
// and use the expected content-type for a post, instead of the LLHTTPClient::postRaw() default of "application/octet-stream"
- headers[HTTP_HEADER_CONTENT_TYPE] = "application/x-www-form-urlencoded";
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "application/x-www-form-urlencoded";
// postRaw() takes ownership of the buffer and releases it later, so we need to allocate a new buffer here.
size_t size = openid_token.size();
@@ -2631,9 +2627,9 @@ void LLViewerMediaImpl::navigateInternal()
// Accept: application/llsd+xml
// which is really not what we want.
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
// Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com
- headers[HTTP_HEADER_COOKIE] = "";
+ headers[HTTP_OUT_HEADER_COOKIE] = "";
LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f);
}
else if("data" == scheme || "file" == scheme || "about" == scheme)
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index ee78ba20cb..567138e160 100644
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -167,9 +167,8 @@ public:
if (getStatus() == HTTP_SEE_OTHER)
{
LLSD headers = LLViewerMedia::getHeaders();
- headers[HTTP_HEADER_COOKIE] = LLWebProfile::getAuthCookie();
- const bool check_lower=true;
- const std::string& redir_url = getResponseHeader(HTTP_HEADER_LOCATION, check_lower);
+ headers[HTTP_OUT_HEADER_COOKIE] = LLWebProfile::getAuthCookie();
+ const std::string& redir_url = getResponseHeader(HTTP_IN_HEADER_LOCATION);
if (redir_url.empty())
{
llwarns << "Received empty redirection URL " << dumpResponse() << llendl;
@@ -207,7 +206,7 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
LLSD headers = LLViewerMedia::getHeaders();
- headers[HTTP_HEADER_COOKIE] = getAuthCookie();
+ headers[HTTP_OUT_HEADER_COOKIE] = getAuthCookie();
LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers);
}
@@ -231,8 +230,8 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
const std::string boundary = "----------------------------0123abcdefab";
LLSD headers = LLViewerMedia::getHeaders();
- headers[HTTP_HEADER_COOKIE] = getAuthCookie();
- headers[HTTP_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + boundary;
+ headers[HTTP_OUT_HEADER_COOKIE] = getAuthCookie();
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + boundary;
std::ostringstream body;
diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp
index ba536ac582..7036162014 100644
--- a/indra/newview/llwebsharing.cpp
+++ b/indra/newview/llwebsharing.cpp
@@ -55,25 +55,47 @@ public:
const LLIOPipe::buffer_ptr_t& buffer)
{
LLBufferStream istr(channels, buffer.get());
+ // *TODO: LLSD notation is not actually JSON.
LLPointer<LLSDParser> parser = new LLSDNotationParser();
- if (parser->parse(istr, mContent, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
+ std::string debug_body("(empty)");
+ bool parsed=true;
+ if (EOF == istr.peek())
{
- if (HTTP_CONTENT_JSON == getResponseHeader(HTTP_HEADER_CONTENT_TYPE))
+ parsed=false;
+ }
+ // Try to parse body as llsd, no matter what 'content-type' says.
+ else if (parser->parse(istr, mContent, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
+ {
+ parsed=false;
+ char body[1025];
+ body[1024] = '\0';
+ istr.seekg(0, std::ios::beg);
+ istr.get(body,1024);
+ if (strlen(body) > 0)
{
- mStatus = HTTP_INTERNAL_ERROR;
- mReason = "Failed to deserialize LLSD from JSON response.";
- char body[1025];
- body[1024] = '\0';
- istr.seekg(0, std::ios::beg);
- istr.get(body,1024);
- if (strlen(body) > 0)
- {
- mContent["body"] = body;
- }
+ mContent = body;
+ debug_body = body;
}
}
+ // Only emit a warning if we failed to parse when 'content-type' == 'application/json'
+ if (!parsed && (HTTP_CONTENT_JSON == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE)))
+ {
+ llwarns << "Failed to deserialize LLSD from JSON response. " << getURL()
+ << " [status:" << mStatus << "] "
+ << "(" << mReason << ") body: " << debug_body << llendl;
+ }
+
+ if (!parsed)
+ {
+ // *TODO: This isn't necessarily the server's fault. Using a 5xx code
+ // isn't really appropriate here.
+ // Also, this hides the actual status returned by the server....
+ mStatus = HTTP_INTERNAL_ERROR;
+ mReason = "Failed to deserialize LLSD from JSON response.";
+ }
+
httpCompleted();
}
};
@@ -132,11 +154,10 @@ private:
virtual void httpSuccess()
{
- const bool check_lower=true;
- if (hasResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower))
+ if (hasResponseHeader(HTTP_IN_HEADER_SET_COOKIE))
{
// OpenID request succeeded and returned a session cookie.
- LLWebSharing::instance().receiveSessionCookie(getResponseHeader(HTTP_HEADER_SET_COOKIE, check_lower));
+ LLWebSharing::instance().receiveSessionCookie(getResponseHeader(HTTP_IN_HEADER_SET_COOKIE));
}
}
};
@@ -299,7 +320,7 @@ void LLWebSharing::sendConfigRequest()
LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL;
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON;
+ headers[HTTP_OUT_HEADER_ACCEPT] = HTTP_CONTENT_JSON;
LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers);
}
@@ -310,8 +331,8 @@ void LLWebSharing::sendOpenIDAuthRequest()
LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL;
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_COOKIE] = mOpenIDCookie;
- headers[HTTP_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_COOKIE] = mOpenIDCookie;
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
// Send request, successful login will trigger fetching a security token.
LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers);
@@ -337,10 +358,10 @@ void LLWebSharing::sendSecurityTokenRequest()
LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL;
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_COOKIE] = mSessionCookie;
+ headers[HTTP_OUT_HEADER_COOKIE] = mSessionCookie;
- headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON;
- headers[HTTP_HEADER_CONTENT_TYPE] = HTTP_CONTENT_JSON;
+ headers[HTTP_OUT_HEADER_ACCEPT] = HTTP_CONTENT_JSON;
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_JSON;
std::ostringstream body;
body << "{ \"gadgets\": [{ \"url\":\""
@@ -366,10 +387,10 @@ void LLWebSharing::sendUploadRequest()
static const std::string BOUNDARY("------------abcdef012345xyZ");
LLSD headers = LLSD::emptyMap();
- headers[HTTP_HEADER_COOKIE] = mSessionCookie;
+ headers[HTTP_OUT_HEADER_COOKIE] = mSessionCookie;
- headers[HTTP_HEADER_ACCEPT] = HTTP_CONTENT_JSON;
- headers[HTTP_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + BOUNDARY;
+ headers[HTTP_OUT_HEADER_ACCEPT] = HTTP_CONTENT_JSON;
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + BOUNDARY;
std::ostringstream body;
body << "--" << BOUNDARY << "\r\n"
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 604e08161e..7c5f8be1b5 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -331,7 +331,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
This might help with bug #503 */
mCurlRequest->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1);
- mCurlRequest->slist_append(HTTP_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML);
+ mCurlRequest->slist_append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML);
if (useGzip)
{