reduce xfer burst if we are busy

LSLKeyTest
UbitUmarov 2016-07-11 12:05:47 +01:00
parent a92266d58e
commit 79fb13c95c
1 changed files with 7 additions and 3 deletions

View File

@ -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;