diff options
author | Melanie | 2009-11-04 23:12:56 +0000 |
---|---|---|
committer | Melanie | 2009-11-04 23:12:56 +0000 |
commit | b6ea7c26ac7653a144b5880e3027fcddabe872e8 (patch) | |
tree | c03844fdd54282c3574f5e2830bd3fcf198f5cf5 /OpenSim/Region | |
parent | Add some length to the backet buffer for packet sending so oversize (diff) | |
download | opensim-SC_OLD-b6ea7c26ac7653a144b5880e3027fcddabe872e8.zip opensim-SC_OLD-b6ea7c26ac7653a144b5880e3027fcddabe872e8.tar.gz opensim-SC_OLD-b6ea7c26ac7653a144b5880e3027fcddabe872e8.tar.bz2 opensim-SC_OLD-b6ea7c26ac7653a144b5880e3027fcddabe872e8.tar.xz |
Refine oversized packet handling as per jhurliman. Reallocate the buffer to
actual packet size only for oversized packets.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 93c3270..6165984 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
327 | // The vast majority of packets are less than 200 bytes, although due to asset transfers and packet splitting | 327 | // The vast majority of packets are less than 200 bytes, although due to asset transfers and packet splitting |
328 | // there are a decent number of packets in the 1000-1140 byte range. We allocate one of two sizes of data here | 328 | // there are a decent number of packets in the 1000-1140 byte range. We allocate one of two sizes of data here |
329 | // to accomodate for both common scenarios and provide ample room for ACK appending in both | 329 | // to accomodate for both common scenarios and provide ample room for ACK appending in both |
330 | int bufferSize = (dataLength > 180) ? LLUDPServer.MTU + 1000 : 200; | 330 | int bufferSize = (dataLength > 180) ? LLUDPServer.MTU : 200; |
331 | 331 | ||
332 | UDPPacketBuffer buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize); | 332 | UDPPacketBuffer buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize); |
333 | 333 | ||
@@ -359,9 +359,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
359 | } | 359 | } |
360 | else | 360 | else |
361 | { | 361 | { |
362 | m_log.Error("[LLUDPSERVER]: Packet exceeded buffer size! This could be an indication of packet assembly not obeying the MTU. Type=" + | 362 | bufferSize = dataLength; |
363 | type + ", DataLength=" + dataLength + ", BufferLength=" + buffer.Data.Length + ". Dropping packet"); | 363 | buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize); |
364 | return; | 364 | |
365 | // m_log.Error("[LLUDPSERVER]: Packet exceeded buffer size! This could be an indication of packet assembly not obeying the MTU. Type=" + | ||
366 | // type + ", DataLength=" + dataLength + ", BufferLength=" + buffer.Data.Length + ". Dropping packet"); | ||
367 | Buffer.BlockCopy(data, 0, buffer.Data, 0, dataLength); | ||
365 | } | 368 | } |
366 | } | 369 | } |
367 | 370 | ||