summaryrefslogtreecommitdiff
path: root/indra/llmessage/llhttpclient.cpp
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-06-13 18:02:37 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-06-13 18:02:37 +0000
commitf118e7c80b95d8c0a0c8abb14ff379b6697e01b6 (patch)
treedb55a74f8d18b3c366608a537e2a32f6d089d56f /indra/llmessage/llhttpclient.cpp
parent680667d4bdca7e2a6df15cd6f16f34c12c97da8e (diff)
result of merge manually performed through diff and patch. svn diff svn+ssh://svn/svn/linden/release@63615 svn+ssh://svn/svn/linden/branches/release-candidate@63637 | patch -p0 in release
Diffstat (limited to 'indra/llmessage/llhttpclient.cpp')
-rw-r--r--indra/llmessage/llhttpclient.cpp53
1 files changed, 32 insertions, 21 deletions
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index a7d187f534..16586dc9c7 100644
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -50,6 +50,29 @@ void LLHTTPClient::Responder::result(const LLSD& content)
{
}
+// virtual
+void LLHTTPClient::Responder::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
+{
+ LLBufferStream istr(channels, buffer.get());
+ LLSD content;
+
+ if (200 <= status && status < 300)
+ {
+ LLSDSerialize::fromXML(content, istr);
+/*
+ const S32 parseError = -1;
+ if(LLSDSerialize::fromXML(content, istr) == parseError)
+ {
+ mStatus = 498;
+ mReason = "Client Parse Error";
+ }
+*/
+ }
+
+ completed(status, reason, content);
+}
+
// virtual
void LLHTTPClient::Responder::completed(U32 status, const std::string& reason, const LLSD& content)
{
@@ -88,25 +111,9 @@ namespace
virtual void complete(const LLChannelDescriptors& channels,
const buffer_ptr_t& buffer)
{
- LLBufferStream istr(channels, buffer.get());
- LLSD content;
-
- if (200 <= mStatus && mStatus < 300)
- {
- LLSDSerialize::fromXML(content, istr);
-/*
- const S32 parseError = -1;
- if(LLSDSerialize::fromXML(content, istr) == parseError)
- {
- mStatus = 498;
- mReason = "Client Parse Error";
- }
-*/
- }
-
if (mResponder.get())
{
- mResponder->completed(mStatus, mReason, content);
+ mResponder->completedRaw(mStatus, mReason, channels, buffer);
}
}
@@ -223,15 +230,18 @@ namespace
LLPumpIO* theClientPump = NULL;
}
-static void request(const std::string& url, LLURLRequest::ERequestAction method,
- Injector* body_injector, LLHTTPClient::ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS)
+static void request(
+ const std::string& url,
+ LLURLRequest::ERequestAction method,
+ Injector* body_injector,
+ LLHTTPClient::ResponderPtr responder,
+ const F32 timeout=HTTP_REQUEST_EXPIRY_SECS)
{
if (!LLHTTPClient::hasPump())
{
responder->completed(U32_MAX, "No pump", LLSD());
return;
}
-
LLPumpIO::chain_t chain;
LLURLRequest *req = new LLURLRequest(method, url);
@@ -242,7 +252,8 @@ static void request(const std::string& url, LLURLRequest::ERequestAction method,
}
req->setCallback(new LLHTTPClientURLAdaptor(responder));
- if (method == LLURLRequest::HTTP_POST && gMessageSystem) {
+ if (method == LLURLRequest::HTTP_POST && gMessageSystem)
+ {
req->addHeader(llformat("X-SecondLife-UDP-Listen-Port: %d",
gMessageSystem->mPort).c_str());
}