summaryrefslogtreecommitdiff
path: root/indra/llmessage/message.cpp
diff options
context:
space:
mode:
authorDave Simmons <simon@lindenlab.com>2009-03-20 20:00:47 +0000
committerDave Simmons <simon@lindenlab.com>2009-03-20 20:00:47 +0000
commit24b26d71ee01211aa796b8061b66ec06a133e4ce (patch)
tree96bffcd019c933ad3ebbfd5f096968108b22aab5 /indra/llmessage/message.cpp
parent5dfd435872e36445dcc82f99443dfc5a7ee0805a (diff)
svn merge -r113004:115000 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26
Merge latest 1.26 into trunk
Diffstat (limited to 'indra/llmessage/message.cpp')
-rw-r--r--indra/llmessage/message.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 8ab12ce991..78af35bf65 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -923,6 +923,28 @@ LLSD LLMessageSystem::wrapReceivedTemplateData() const
}
}
+LLSD LLMessageSystem::wrapBuiltTemplateData() const
+{
+ LLSD result;
+ if (mLLSDMessageBuilder == mMessageBuilder)
+ {
+ result = getBuiltMessageLLSD();
+ }
+ else
+ {
+ U8 buffer[MAX_BUFFER_SIZE];
+ const U8 offset_to_data = 0;
+ U32 size = mTemplateMessageBuilder->buildMessage(
+ buffer, MAX_BUFFER_SIZE,
+ offset_to_data);
+ std::vector<U8> binary_data(buffer, buffer+size);
+ LLSD wrapped_data = LLSD::emptyMap();
+ wrapped_data["binary-template-data"] = binary_data;
+ result = wrapped_data;
+ }
+ return result;
+}
+
LLStoredMessagePtr LLMessageSystem::getReceivedMessage() const
{
const std::string& name = mMessageReader->getMessageName();
@@ -934,7 +956,7 @@ LLStoredMessagePtr LLMessageSystem::getReceivedMessage() const
LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const
{
const std::string& name = mMessageBuilder->getMessageName();
- LLSD message = getBuiltMessageLLSD();
+ LLSD message = wrapBuiltTemplateData();
return LLStoredMessagePtr(new LLStoredMessage(name, message));
}
@@ -1131,7 +1153,7 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n
return new LLFnPtrResponder(
NULL,
NULL,
- mMessageBuilder->getMessageName());
+ name);
}
}