aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
authoridb2009-03-07 14:16:26 +0000
committeridb2009-03-07 14:16:26 +0000
commitaab1601642ef6c1b028fc3160e809732ab4d1769 (patch)
tree7a2321222bc2279dcc689967b22c16b70cb8eef5 /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
parentAdded the ability to set User-Agent in llHTTPRequest. No new default value ha... (diff)
downloadopensim-SC-aab1601642ef6c1b028fc3160e809732ab4d1769.zip
opensim-SC-aab1601642ef6c1b028fc3160e809732ab4d1769.tar.gz
opensim-SC-aab1601642ef6c1b028fc3160e809732ab4d1769.tar.bz2
opensim-SC-aab1601642ef6c1b028fc3160e809732ab4d1769.tar.xz
Limit the message length from llInstantMessage to 1024 characters http://wiki.secondlife.com/wiki/LlInstantMessage
Also truncate messages that may exceed the limit set by the packet size. The limit in OpenMetaverse is 1100 bytes including a zero byte terminator. Fixes Mantis #3244
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6e1bd82..ac427d7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1206,7 +1206,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1206 msg.MessageBlock.RegionID = UUID.Zero; 1206 msg.MessageBlock.RegionID = UUID.Zero;
1207 msg.MessageBlock.Timestamp = timeStamp; 1207 msg.MessageBlock.Timestamp = timeStamp;
1208 msg.MessageBlock.ToAgentID = toAgent; 1208 msg.MessageBlock.ToAgentID = toAgent;
1209 msg.MessageBlock.Message = Utils.StringToBytes(message); 1209 // Cap the message length at 1099. There is a limit in ImprovedInstantMessagePacket
1210 // the limit is 1100 but a 0 byte gets added to mark the end of the string
1211 if (message != null && message.Length > 1099)
1212 msg.MessageBlock.Message = Utils.StringToBytes(message.Substring(0, 1099));
1213 else
1214 msg.MessageBlock.Message = Utils.StringToBytes(message);
1210 msg.MessageBlock.BinaryBucket = binaryBucket; 1215 msg.MessageBlock.BinaryBucket = binaryBucket;
1211 1216
1212 if (message.StartsWith("[grouptest]")) 1217 if (message.StartsWith("[grouptest]"))