aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/IClientAPI.cs3
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs19
-rw-r--r--OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs26
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs3
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs3
6 files changed, 31 insertions, 27 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 8d0cb5a..68ca52e 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1235,7 +1235,8 @@ namespace OpenSim.Framework
1235 /// <param name="node"></param> 1235 /// <param name="node"></param>
1236 void SendBulkUpdateInventory(InventoryNodeBase node); 1236 void SendBulkUpdateInventory(InventoryNodeBase node);
1237 1237
1238 void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory); 1238 void SendXferPacket(ulong xferID, uint packet,
1239 byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory);
1239 1240
1240 void SendAbortXferPacket(ulong xferID); 1241 void SendAbortXferPacket(ulong xferID);
1241 1242
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 01a9fb6..5d4d5cd 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -2886,7 +2886,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2886 18 // ID (high frequency bigendian) 2886 18 // ID (high frequency bigendian)
2887 }; 2887 };
2888 2888
2889 public void SendXferPacket(ulong xferID, uint packet, byte[] payload, bool isTaskInventory) 2889 public void SendXferPacket(ulong xferID, uint packet,
2890 byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory)
2890 { 2891 {
2891 UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint); 2892 UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint);
2892 byte[] data = buf.Data; 2893 byte[] data = buf.Data;
@@ -2896,7 +2897,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2896 2897
2897 Utils.UInt64ToBytesSafepos(xferID, data, 7); // 15 2898 Utils.UInt64ToBytesSafepos(xferID, data, 7); // 15
2898 Utils.UIntToBytesSafepos(packet, data, 15); // 19 2899 Utils.UIntToBytesSafepos(packet, data, 15); // 19
2899 int len = payload.Length; 2900
2901 int len = XferDatapktLen;
2902 if (XferDataOffset == 0) // first packet needs to send the total xfer data len
2903 len += 4;
2904
2900 if (len > LLUDPServer.MAXPAYLOAD) // should never happen 2905 if (len > LLUDPServer.MAXPAYLOAD) // should never happen
2901 len = LLUDPServer.MAXPAYLOAD; 2906 len = LLUDPServer.MAXPAYLOAD;
2902 if (len == 0) 2907 if (len == 0)
@@ -2908,7 +2913,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2908 { 2913 {
2909 data[19] = (byte)len; 2914 data[19] = (byte)len;
2910 data[20] = (byte)(len >> 8); 2915 data[20] = (byte)(len >> 8);
2911 Buffer.BlockCopy(payload, 0, data, 21, len); 2916 if(XferDataOffset == 0)
2917 {
2918 // need to send total xfer data len
2919 Utils.IntToBytesSafepos(XferData.Length, data, 21);
2920 if (XferDatapktLen > 0)
2921 Buffer.BlockCopy(XferData, XferDataOffset, data, 25, XferDatapktLen);
2922 }
2923 else
2924 Buffer.BlockCopy(XferData, XferDataOffset, data, 21, XferDatapktLen);
2912 } 2925 }
2913 2926
2914 buf.DataLength = 21 + len; 2927 buf.DataLength = 21 + len;
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;
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 16be1c8..e27bbc3 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1157,7 +1157,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1157 1157
1158 } 1158 }
1159 1159
1160 public void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) 1160 public void SendXferPacket(ulong xferID, uint packet,
1161 byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory)
1161 { 1162 {
1162 1163
1163 } 1164 }
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index b2a9716..d3eb25f 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -868,9 +868,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
868 { 868 {
869 } 869 }
870 870
871 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) 871 public virtual void SendXferPacket(ulong xferID, uint packet,
872 byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory)
872 { 873 {
873 } 874 }
875
874 public virtual void SendAbortXferPacket(ulong xferID) 876 public virtual void SendAbortXferPacket(ulong xferID)
875 { 877 {
876 878
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 3cd5253..fd14291 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -819,7 +819,8 @@ namespace OpenSim.Tests.Common
819 { 819 {
820 } 820 }
821 821
822 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) 822 public virtual void SendXferPacket(ulong xferID, uint packet,
823 byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory)
823 { 824 {
824 } 825 }
825 826