diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index 1b6401a..94e8064 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | |||
@@ -272,9 +272,9 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
272 | if (!Transfers.ContainsKey(xferID)) | 272 | if (!Transfers.ContainsKey(xferID)) |
273 | { | 273 | { |
274 | byte[] fileData = NewFiles[fileName].Data; | 274 | byte[] fileData = NewFiles[fileName].Data; |
275 | int burstSize = remoteClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset) >> 11; | 275 | int burstSize = remoteClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Task) >> 10; |
276 | if(Transfers.Count > 1) | 276 | burstSize = burstSize * (remoteClient.PingTimeMS + 50); |
277 | burstSize /= Transfers.Count; | 277 | burstSize >>= 9; // ping is ms, 2 round trips |
278 | XferDownLoad transaction = | 278 | XferDownLoad transaction = |
279 | new XferDownLoad(fileName, fileData, xferID, remoteClient, burstSize); | 279 | new XferDownLoad(fileName, fileData, xferID, remoteClient, burstSize); |
280 | 280 | ||
@@ -332,7 +332,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
332 | private int lastBytes; | 332 | private int lastBytes; |
333 | private int lastSentPacket; | 333 | private int lastSentPacket; |
334 | private int lastAckPacket; | 334 | private int lastAckPacket; |
335 | private int burstSize; | 335 | private int burstSize; // additional packets, so can be zero |
336 | private int retries = 0; | 336 | private int retries = 0; |
337 | 337 | ||
338 | public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client, int burstsz) | 338 | public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client, int burstsz) |
@@ -352,7 +352,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
352 | { | 352 | { |
353 | if(!isDeleted) | 353 | if(!isDeleted) |
354 | { | 354 | { |
355 | Data = new byte[0]; | 355 | Data = null; |
356 | isDeleted = true; | 356 | isDeleted = true; |
357 | } | 357 | } |
358 | } | 358 | } |
@@ -381,7 +381,6 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
381 | lastBytes = 1024; | 381 | lastBytes = 1024; |
382 | LastPacket--; | 382 | LastPacket--; |
383 | } | 383 | } |
384 | |||
385 | } | 384 | } |
386 | 385 | ||
387 | lastAckPacket = -1; | 386 | lastAckPacket = -1; |
@@ -422,20 +421,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
422 | pktid = (uint)pkt; | 421 | pktid = (uint)pkt; |
423 | } | 422 | } |
424 | 423 | ||
425 | byte[] transferData; | 424 | Client.SendXferPacket(XferID, pktid, Data, pkt << 10, pktsize, true); |
426 | if(pkt == 0) | ||
427 | { | ||
428 | transferData = new byte[pktsize + 4]; | ||
429 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | ||
430 | Array.Copy(Data, 0, transferData, 4, pktsize); | ||
431 | } | ||
432 | else | ||
433 | { | ||
434 | transferData = new byte[pktsize]; | ||
435 | Array.Copy(Data, pkt << 10, transferData, 0, pktsize); | ||
436 | } | ||
437 | |||
438 | Client.SendXferPacket(XferID, pktid, transferData, false); | ||
439 | 425 | ||
440 | lastSentPacket = pkt; | 426 | lastSentPacket = pkt; |
441 | lastsendTimeMS = now; | 427 | lastsendTimeMS = now; |