udp transfer: make number packets estimation coerent with number actually sent. Use the safer lower max packet size defined in os source (600) and not OMV one (1100).

avinationmerge
UbitUmarov 2012-05-17 13:13:31 +01:00
parent 6af78836a5
commit 7652b3a957
1 changed files with 8 additions and 2 deletions

View File

@ -329,6 +329,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private Prioritizer m_prioritizer; private Prioritizer m_prioritizer;
private bool m_disableFacelights = false; private bool m_disableFacelights = false;
private const uint MaxTransferBytesPerPacket = 600;
/// <value> /// <value>
/// List used in construction of data blocks for an object update packet. This is to stop us having to /// List used in construction of data blocks for an object update packet. This is to stop us having to
/// continually recreate it. /// continually recreate it.
@ -2738,7 +2741,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
else else
{ {
int processedLength = 0; int processedLength = 0;
int maxChunkSize = Settings.MAX_PACKET_SIZE - 100; // int maxChunkSize = Settings.MAX_PACKET_SIZE - 100;
int maxChunkSize = (int) MaxTransferBytesPerPacket;
int packetNumber = 0; int packetNumber = 0;
while (processedLength < req.AssetInf.Data.Length) while (processedLength < req.AssetInf.Data.Length)
@ -12202,7 +12207,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <returns></returns> /// <returns></returns>
private static int CalculateNumPackets(byte[] data) private static int CalculateNumPackets(byte[] data)
{ {
const uint m_maxPacketSize = 600; // const uint m_maxPacketSize = 600;
uint m_maxPacketSize = MaxTransferBytesPerPacket;
int numPackets = 1; int numPackets = 1;
if (data == null) if (data == null)