From 79fb13c95c7a752c44f3d6304788f0fc61f3414a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 11 Jul 2016 12:05:47 +0100 Subject: [PATCH] reduce xfer burst if we are busy --- OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index 437cbcd085..41ce860ff4 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -266,8 +266,11 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer if (!Transfers.ContainsKey(xferID)) { byte[] fileData = NewFiles[fileName].Data; + int burstSize = remoteClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset) >> 11; + if(Transfers.Count > 1) + burstSize /= Transfers.Count; XferDownLoad transaction = - new XferDownLoad(fileName, fileData, xferID, remoteClient); + new XferDownLoad(fileName, fileData, xferID, remoteClient, burstSize); Transfers.Add(xferID, transaction); @@ -326,12 +329,13 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer private int burstSize; private int retries = 0; - public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) + public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client, int burstsz) { FileName = fileName; Data = data; XferID = xferID; Client = client; + burstSize = burstsz; } public XferDownLoad() @@ -371,7 +375,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer lastBytes = 1024; LastPacket--; } - burstSize = Client.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset) >> 11; + } lastAckPacket = -1;