diff options
author | onefang | 2019-07-08 13:35:18 +1000 |
---|---|---|
committer | onefang | 2019-07-08 13:35:18 +1000 |
commit | 1ec53d689307da4b49d09ba264d73816d036bf94 (patch) | |
tree | a87ce12d1814a6bf0758ae3e31a45c30e71d9ab0 | |
parent | Use F1 instead of ? as the in command help key. (diff) | |
download | opensim-SC-1ec53d689307da4b49d09ba264d73816d036bf94.zip opensim-SC-1ec53d689307da4b49d09ba264d73816d036bf94.tar.gz opensim-SC-1ec53d689307da4b49d09ba264d73816d036bf94.tar.bz2 opensim-SC-1ec53d689307da4b49d09ba264d73816d036bf94.tar.xz |
Attempt to render "[LLUDPSERVER]: Malformed data, cannot parse" into something human readable as an aid to diagnosis.
Beats hand translating the big block of hex codes it was spewing.
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index b575ed9..69239b1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -32,6 +32,8 @@ using System.IO; | |||
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Net.Sockets; | 33 | using System.Net.Sockets; |
34 | using System.Reflection; | 34 | using System.Reflection; |
35 | using System.Text; | ||
36 | using System.Text.RegularExpressions; | ||
35 | using System.Threading; | 37 | using System.Threading; |
36 | using log4net; | 38 | using log4net; |
37 | using Nini.Config; | 39 | using Nini.Config; |
@@ -1311,8 +1313,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1311 | { | 1313 | { |
1312 | if (IncomingMalformedPacketCount < 100) | 1314 | if (IncomingMalformedPacketCount < 100) |
1313 | { | 1315 | { |
1314 | m_log.WarnFormat("[LLUDPSERVER]: Malformed data, cannot parse {0} byte packet from {1}, data {2}:", | 1316 | m_log.WarnFormat("[LLUDPSERVER]: Malformed data, cannot parse {0} byte packet from {1}, data as hex {2}: {3}", |
1315 | buffer.DataLength, buffer.RemoteEndPoint, Utils.BytesToHexString(buffer.Data, buffer.DataLength, null)); | 1317 | buffer.DataLength, buffer.RemoteEndPoint, Utils.BytesToHexString(buffer.Data, buffer.DataLength, null), |
1318 | Regex.Replace(Encoding.UTF8.GetString(buffer.Data, 0, buffer.DataLength), @"\p{Cc}", a=>string.Format("[{0:X2}]", (byte)a.Value[0]))); | ||
1316 | } | 1319 | } |
1317 | 1320 | ||
1318 | RecordMalformedInboundPacket(endPoint); | 1321 | RecordMalformedInboundPacket(endPoint); |