summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorMark Palange <palange@lindenlab.com>2008-10-07 22:49:00 +0000
committerMark Palange <palange@lindenlab.com>2008-10-07 22:49:00 +0000
commit4296542cd062af425d7744c88d6dd2bd00daf532 (patch)
tree8926d4f0bfaa9ed672f4cf90577afcf8e7f44a97 /indra/llmessage
parentc9be97fdfcc6a4c6b23a8c90916af54a38d60ab0 (diff)
Roll back of r98854 Accidentally commited merge in progress
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llmessagetemplate.h7
-rw-r--r--indra/llmessage/lltemplatemessagebuilder.cpp1
-rw-r--r--indra/llmessage/lltemplatemessagereader.cpp1
-rw-r--r--indra/llmessage/llurlrequest.cpp42
-rw-r--r--indra/llmessage/message.cpp2
5 files changed, 24 insertions, 29 deletions
diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h
index db8252270a..82421b1f5a 100644
--- a/indra/llmessage/llmessagetemplate.h
+++ b/indra/llmessage/llmessagetemplate.h
@@ -300,7 +300,7 @@ public:
~LLMessageTemplate()
{
for_each(mMemberBlocks.begin(), mMemberBlocks.end(), DeletePointer());
- }
+}
void addBlock(LLMessageBlock *blockp)
{
@@ -388,11 +388,6 @@ public:
return trustedSource ? mBanFromTrusted : mBanFromUntrusted;
}
- bool isUdpBanned() const
- {
- return mDeprecation == MD_UDPBLACKLISTED;
- }
-
friend std::ostream& operator<<(std::ostream& s, LLMessageTemplate &msg);
const LLMessageBlock* getBlock(char* name) const
diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp
index a721f2848c..70c306c060 100644
--- a/indra/llmessage/lltemplatemessagebuilder.cpp
+++ b/indra/llmessage/lltemplatemessagebuilder.cpp
@@ -60,6 +60,7 @@ LLTemplateMessageBuilder::~LLTemplateMessageBuilder()
mCurrentSMessageData = NULL;
}
+
// virtual
void LLTemplateMessageBuilder::newMessage(const char *name)
{
diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp
index fada34507b..822051d363 100644
--- a/indra/llmessage/lltemplatemessagereader.cpp
+++ b/indra/llmessage/lltemplatemessagereader.cpp
@@ -791,6 +791,7 @@ bool LLTemplateMessageReader::isTrusted() const
return mCurrentRMessageTemplate->getTrust() == MT_TRUST;
}
+//virtual
bool LLTemplateMessageReader::isBanned(bool trustedSource) const
{
return mCurrentRMessageTemplate->isBanned(trustedSource);
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 518e54b79c..ff6ec9f077 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -503,29 +503,27 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user)
// Per HTTP spec the first header line must be the status line.
if (!complete->haveHTTPStatus())
{
- 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);
+
+ int statusCode = atoi(status.c_str());
+ if (statusCode > 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)statusCode, reason);
+ }
+ else
+ {
+ llwarns << "Unable to parse http response status line: "
+ << header << llendl;
+ complete->httpStatus(499,"Unable to parse status line.");
}
return header_len;
}
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 08bed857ce..abd9467602 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -754,7 +754,6 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
clearReceiveState();
valid_packet = FALSE;
}
-
if( valid_packet && mTemplateMessageReader->isUdpBanned())
{
llwarns << "Received UDP black listed message "
@@ -767,6 +766,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
if( valid_packet )
{
logValidMsg(cdp, host, recv_reliable, recv_resent, (BOOL)(acks>0) );
+
valid_packet = mTemplateMessageReader->readMessage(buffer, host);
}