aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index f6dd5af..0aa4693 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -136,18 +136,27 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
136 136
137 if (XferID == xferID) 137 if (XferID == xferID)
138 { 138 {
139 if (m_asset.Data.Length > 1) 139 lock (this)
140 { 140 {
141 byte[] destinationArray = new byte[m_asset.Data.Length + data.Length]; 141 int assetLength = m_asset.Data.Length;
142 Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length); 142 int dataLength = data.Length;
143 Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length); 143
144 m_asset.Data = destinationArray; 144 if (m_asset.Data.Length > 1)
145 } 145 {
146 else 146 byte[] destinationArray = new byte[assetLength + dataLength];
147 { 147 Array.Copy(m_asset.Data, 0, destinationArray, 0, assetLength);
148 byte[] buffer2 = new byte[data.Length - 4]; 148 Array.Copy(data, 0, destinationArray, assetLength, dataLength);
149 Array.Copy(data, 4, buffer2, 0, data.Length - 4); 149 m_asset.Data = destinationArray;
150 m_asset.Data = buffer2; 150 }
151 else
152 {
153 if (dataLength > 4)
154 {
155 byte[] buffer2 = new byte[dataLength - 4];
156 Array.Copy(data, 4, buffer2, 0, dataLength - 4);
157 m_asset.Data = buffer2;
158 }
159 }
151 } 160 }
152 161
153 ourClient.SendConfirmXfer(xferID, packetID); 162 ourClient.SendConfirmXfer(xferID, packetID);