diff options
author | Justin Clark-Casey (justincc) | 2012-09-25 22:08:11 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-25 22:08:11 +0100 |
commit | 2f795e4fa6433269748f4e062d4bba7197e46ab1 (patch) | |
tree | 1e0dc74b54aa905225962031af777e19638f683f /OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |
parent | Fix occasional race condition failure when creating new clothing/body parts i... (diff) | |
download | opensim-SC_OLD-2f795e4fa6433269748f4e062d4bba7197e46ab1.zip opensim-SC_OLD-2f795e4fa6433269748f4e062d4bba7197e46ab1.tar.gz opensim-SC_OLD-2f795e4fa6433269748f4e062d4bba7197e46ab1.tar.bz2 opensim-SC_OLD-2f795e4fa6433269748f4e062d4bba7197e46ab1.tar.xz |
Move UDP update task item code to AssetXferUploader to match existing create user item and update user item mechanisms
This is done for consistency and to allow removal or some access methods that increase code complexity.
However, this path has not been used for a long time, not even by LL 1.23 - viewers use caps http upload for this instead
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index bba7b9c..59d0075 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -155,56 +155,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
155 | description, name, invType, type, wearableType, nextOwnerMask); | 155 | description, name, invType, type, wearableType, nextOwnerMask); |
156 | } | 156 | } |
157 | 157 | ||
158 | /// <summary> | ||
159 | /// Get an uploaded asset. If the data is successfully retrieved, | ||
160 | /// the transaction will be removed. | ||
161 | /// </summary> | ||
162 | /// <param name="transactionID"></param> | ||
163 | /// <returns>The asset if the upload has completed, null if it has not.</returns> | ||
164 | private AssetBase GetTransactionAsset(UUID transactionID) | ||
165 | { | ||
166 | lock (XferUploaders) | ||
167 | { | ||
168 | if (XferUploaders.ContainsKey(transactionID)) | ||
169 | { | ||
170 | AssetXferUploader uploader = XferUploaders[transactionID]; | ||
171 | AssetBase asset = uploader.GetAssetData(); | ||
172 | RemoveXferUploader(transactionID); | ||
173 | |||
174 | return asset; | ||
175 | } | ||
176 | } | ||
177 | |||
178 | return null; | ||
179 | } | ||
180 | |||
181 | public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, | 158 | public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, |
182 | SceneObjectPart part, UUID transactionID, | 159 | SceneObjectPart part, UUID transactionID, |
183 | TaskInventoryItem item) | 160 | TaskInventoryItem item) |
184 | { | 161 | { |
185 | AssetBase asset = GetTransactionAsset(transactionID); | 162 | AssetXferUploader uploader = RequestXferUploader(transactionID); |
186 | |||
187 | // Only legacy viewers use this, and they prefer CAPS, which | ||
188 | // we have, so this really never runs. | ||
189 | // Allow it, but only for "safe" types. | ||
190 | if ((InventoryType)item.InvType != InventoryType.Notecard && | ||
191 | (InventoryType)item.InvType != InventoryType.LSL) | ||
192 | return; | ||
193 | 163 | ||
194 | if (asset != null) | 164 | uploader.RequestUpdateTaskInventoryItem(remoteClient, transactionID, item); |
195 | { | ||
196 | // m_log.DebugFormat( | ||
197 | // "[AGENT ASSETS TRANSACTIONS]: Updating item {0} in {1} for transaction {2}", | ||
198 | // item.Name, part.Name, transactionID); | ||
199 | |||
200 | asset.FullID = UUID.Random(); | ||
201 | asset.Name = item.Name; | ||
202 | asset.Description = item.Description; | ||
203 | asset.Type = (sbyte)item.Type; | ||
204 | item.AssetID = asset.FullID; | ||
205 | |||
206 | m_Scene.AssetService.Store(asset); | ||
207 | } | ||
208 | } | 165 | } |
209 | 166 | ||
210 | public void RequestUpdateInventoryItem(IClientAPI remoteClient, | 167 | public void RequestUpdateInventoryItem(IClientAPI remoteClient, |