aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/message.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/llmessage/message.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llmessage/message.cpp65
1 files changed, 46 insertions, 19 deletions
diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp
index fefbb4e..ee295d7 100644
--- a/linden/indra/llmessage/message.cpp
+++ b/linden/indra/llmessage/message.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -705,21 +705,28 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
705 // But we don't want to acknowledge UseCircuitCode until the circuit is 705 // But we don't want to acknowledge UseCircuitCode until the circuit is
706 // available, which is why the acknowledgement test is done above. JC 706 // available, which is why the acknowledgement test is done above. JC
707 707
708 valid_packet = mTemplateMessageReader->validateMessage(buffer, 708 valid_packet = mTemplateMessageReader->validateMessage(
709 receive_size, 709 buffer,
710 host); 710 receive_size,
711 host);
711 712
712 // UseCircuitCode is allowed in even from an invalid circuit, so that 713 // UseCircuitCode is allowed in even from an invalid circuit, so that
713 // we can toss circuits around. 714 // we can toss circuits around.
714 if(valid_packet && !cdp && 715 if(
715 (mTemplateMessageReader->getMessageName() != _PREHASH_UseCircuitCode)) 716 valid_packet &&
717 !cdp &&
718 (mTemplateMessageReader->getMessageName() !=
719 _PREHASH_UseCircuitCode))
716 { 720 {
717 logMsgFromInvalidCircuit( host, recv_reliable ); 721 logMsgFromInvalidCircuit( host, recv_reliable );
718 clearReceiveState(); 722 clearReceiveState();
719 valid_packet = FALSE; 723 valid_packet = FALSE;
720 } 724 }
721 725
722 if(valid_packet && cdp && !cdp->getTrusted() && 726 if(
727 valid_packet &&
728 cdp &&
729 !cdp->getTrusted() &&
723 mTemplateMessageReader->isTrusted()) 730 mTemplateMessageReader->isTrusted())
724 { 731 {
725 logTrustedMsgFromUntrustedCircuit( host ); 732 logTrustedMsgFromUntrustedCircuit( host );
@@ -729,8 +736,9 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
729 valid_packet = FALSE; 736 valid_packet = FALSE;
730 } 737 }
731 738
732 if (valid_packet 739 if (
733 && mTemplateMessageReader->isBanned(cdp && cdp->getTrusted())) 740 valid_packet &&
741 mTemplateMessageReader->isBanned(cdp && cdp->getTrusted()))
734 { 742 {
735 llwarns << "LLMessageSystem::checkMessages " 743 llwarns << "LLMessageSystem::checkMessages "
736 << "received banned message " 744 << "received banned message "
@@ -1100,6 +1108,17 @@ void LLMessageSystem::forwardReliable(const U32 circuit_code)
1100 sendReliable(findHost(circuit_code)); 1108 sendReliable(findHost(circuit_code));
1101} 1109}
1102 1110
1111S32 LLMessageSystem::forwardReliable( const LLHost &host,
1112 S32 retries,
1113 BOOL ping_based_timeout,
1114 F32 timeout,
1115 void (*callback)(void **,S32),
1116 void ** callback_data)
1117{
1118 copyMessageRtoS();
1119 return sendReliable(host, retries, ping_based_timeout, timeout, callback, callback_data);
1120}
1121
1103S32 LLMessageSystem::flushSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data) 1122S32 LLMessageSystem::flushSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data)
1104{ 1123{
1105 F32 timeout; 1124 F32 timeout;
@@ -1148,9 +1167,10 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n
1148{ 1167{
1149 if(mSendReliable) 1168 if(mSendReliable)
1150 { 1169 {
1151 return new LLFnPtrResponder(mReliablePacketParams.mCallback, 1170 return new LLFnPtrResponder(
1152 mReliablePacketParams.mCallbackData, 1171 mReliablePacketParams.mCallback,
1153 name); 1172 mReliablePacketParams.mCallbackData,
1173 name);
1154 } 1174 }
1155 else 1175 else
1156 { 1176 {
@@ -1159,8 +1179,10 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n
1159// llwarns << "LLMessageSystem::sendMessage: Sending unreliable " 1179// llwarns << "LLMessageSystem::sendMessage: Sending unreliable "
1160// << mMessageBuilder->getMessageName() << " message via HTTP" 1180// << mMessageBuilder->getMessageName() << " message via HTTP"
1161// << llendl; 1181// << llendl;
1162 return new LLFnPtrResponder(NULL, NULL, 1182 return new LLFnPtrResponder(
1163 mMessageBuilder->getMessageName()); 1183 NULL,
1184 NULL,
1185 mMessageBuilder->getMessageName());
1164 } 1186 }
1165} 1187}
1166 1188
@@ -1230,8 +1252,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
1230 LLSD message = mLLSDMessageBuilder->getMessage(); 1252 LLSD message = mLLSDMessageBuilder->getMessage();
1231 1253
1232 const LLHTTPSender& sender = LLHTTPSender::getSender(host); 1254 const LLHTTPSender& sender = LLHTTPSender::getSender(host);
1233 sender.send(host, mLLSDMessageBuilder->getMessageName(), 1255 sender.send(
1234 message, createResponder(mLLSDMessageBuilder->getMessageName())); 1256 host,
1257 mLLSDMessageBuilder->getMessageName(),
1258 message,
1259 createResponder(mLLSDMessageBuilder->getMessageName()));
1235 1260
1236 mSendReliable = FALSE; 1261 mSendReliable = FALSE;
1237 mReliablePacketParams.clear(); 1262 mReliablePacketParams.clear();
@@ -1412,8 +1437,10 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re
1412 } 1437 }
1413} 1438}
1414 1439
1415S32 LLMessageSystem::sendMessage(const LLHost &host, const char* name, 1440S32 LLMessageSystem::sendMessage(
1416 const LLSD& message) 1441 const LLHost &host,
1442 const char* name,
1443 const LLSD& message)
1417{ 1444{
1418 if (!(host.isOk())) 1445 if (!(host.isOk()))
1419 { 1446 {