summaryrefslogtreecommitdiff
path: root/indra/llmessage/llurlrequest.cpp
diff options
context:
space:
mode:
authorRobert Knop <prospero@lindenlab.com>2009-02-06 19:14:32 +0000
committerRobert Knop <prospero@lindenlab.com>2009-02-06 19:14:32 +0000
commitea8e83274ae76598ff7a97eb50991e9f4826091b (patch)
tree4754fa5a431c0470a3f25ac8f89d905c1c714700 /indra/llmessage/llurlrequest.cpp
parent6861459c48f72bb714f307d44e59317a466887bc (diff)
svn merge -r 108748:109731 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.25
Merge server 1.25 back to trunk Conflicts: C indra/llcommon/llversionserver.h : svn reverted C indra/tools/bill/MoneyMachine.pm : one conflict, only difference was a blank line. C indra/newsim/lllslmanager.cpp : kept merge-right, in consultation C indra/newsim/lllslmanager.h : with babbage C indra/newsim/llagentinfo.cpp : (runNested, not runSpecial) C indra/test/test_entity_query.py : Kept merge-right C indra/test/test_agent_linden_dollar.py : Kept merge-right --> Kartic fixed these testes in server-1.25 C indra/test/template/httpd.tmpl : Kept merge-right (the IfModule version)
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
-rw-r--r--indra/llmessage/llurlrequest.cpp49
1 files changed, 17 insertions, 32 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index d03c8dfd25..6ef97bea58 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -502,33 +502,25 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user)
std::string header(header_line, header_len);
// Per HTTP spec the first header line must be the status line.
- if (!complete->haveHTTPStatus())
+ if (header.substr(0,5) == "HTTP/")
{
- if (header.substr(0,5) == "HTTP/")
+ std::string::iterator end = header.end();
+ std::string::iterator pos1 = std::find(header.begin(), end, ' ');
+ if (pos1 != end) ++pos1;
+ std::string::iterator pos2 = std::find(pos1, end, ' ');
+ if (pos2 != end) ++pos2;
+ std::string::iterator pos3 = std::find(pos2, end, '\r');
+
+ std::string version(header.begin(), pos1);
+ std::string status(pos1, pos2);
+ std::string reason(pos2, pos3);
+
+ S32 status_code = atoi(status.c_str());
+ if (status_code > 0)
{
- std::string::iterator end = header.end();
- std::string::iterator pos1 = std::find(header.begin(), end, ' ');
- if (pos1 != end) ++pos1;
- std::string::iterator pos2 = std::find(pos1, end, ' ');
- if (pos2 != end) ++pos2;
- std::string::iterator pos3 = std::find(pos2, end, '\r');
-
- std::string version(header.begin(), pos1);
- std::string status(pos1, pos2);
- std::string reason(pos2, pos3);
-
- int statusCode = atoi(status.c_str());
- if (statusCode >= 300 && statusCode < 400)
- {
- // This is a redirect, ignore it and all headers
- // until we find a normal status code.
- }
- else if (statusCode > 0)
- {
- complete->httpStatus((U32)statusCode, reason);
- }
+ complete->httpStatus((U32)status_code, reason);
+ return header_len;
}
- return header_len;
}
std::string::iterator sep = std::find(header.begin(),header.end(),':');
@@ -593,8 +585,7 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl(
* LLURLRequestComplete
*/
LLURLRequestComplete::LLURLRequestComplete() :
- mRequestStatus(LLIOPipe::STATUS_ERROR),
- mHaveHTTPStatus(false)
+ mRequestStatus(LLIOPipe::STATUS_ERROR)
{
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
}
@@ -611,12 +602,6 @@ void LLURLRequestComplete::header(const std::string& header, const std::string&
}
//virtual
-void LLURLRequestComplete::httpStatus(U32 status, const std::string& reason)
-{
- mHaveHTTPStatus = true;
-}
-
-//virtual
void LLURLRequestComplete::complete(const LLChannelDescriptors& channels,
const buffer_ptr_t& buffer)
{