aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2015-09-11 09:48:51 -0700
committerDiva Canto2015-09-11 09:48:51 -0700
commit29aaf5564f52c0c532910764e4218eb6891184ef (patch)
tree6afb14242bcc0478269ff12909991686af7b10dd /OpenSim
parentTypos in comments (diff)
downloadopensim-SC-29aaf5564f52c0c532910764e4218eb6891184ef.zip
opensim-SC-29aaf5564f52c0c532910764e4218eb6891184ef.tar.gz
opensim-SC-29aaf5564f52c0c532910764e4218eb6891184ef.tar.bz2
opensim-SC-29aaf5564f52c0c532910764e4218eb6891184ef.tar.xz
Mantis #7720: AssetXferUploader was setting AssetID to UUID.Zero. Before that wouldn't matter (item would be a terminal object) but with the introduction of the item cache, it matters, because the object in the cache was being modified to have AssetID=UUID.Zero. Also keeping the item cache consistent when item properties change.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs12
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs10
2 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index 49a96f4..5143204 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -319,12 +319,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
319 m_asset.Description = item.Description; 319 m_asset.Description = item.Description;
320 m_asset.Type = (sbyte)item.AssetType; 320 m_asset.Type = (sbyte)item.AssetType;
321 321
322 // We must always store the item at this point even if the asset hasn't finished uploading, in order 322 if (m_asset.FullID != UUID.Zero)
323 // to avoid a race condition when the appearance module retrieves the item to set the asset id in 323 {
324 // the AvatarAppearance structure. 324 // We must always store the item at this point even if the asset hasn't finished uploading, in order
325 item.AssetID = m_asset.FullID; 325 // to avoid a race condition when the appearance module retrieves the item to set the asset id in
326 if (item.AssetID != UUID.Zero) 326 // the AvatarAppearance structure.
327 item.AssetID = m_asset.FullID;
327 m_Scene.InventoryService.UpdateItem(item); 328 m_Scene.InventoryService.UpdateItem(item);
329 }
328 330
329 if (m_uploadState == UploadState.Complete) 331 if (m_uploadState == UploadState.Complete)
330 { 332 {
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index f235446..7cecd93 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
@@ -474,7 +474,13 @@ namespace OpenSim.Services.Connectors
474 { "CreationDate", item.CreationDate.ToString() } 474 { "CreationDate", item.CreationDate.ToString() }
475 }); 475 });
476 476
477 return CheckReturn(ret); 477 bool result = CheckReturn(ret);
478 if (result)
479 {
480 m_ItemCache.AddOrUpdate(item.ID, item, CACHE_EXPIRATION_SECONDS);
481 }
482
483 return result;
478 } 484 }
479 485
480 public bool MoveItems(UUID principalID, List<InventoryItemBase> items) 486 public bool MoveItems(UUID principalID, List<InventoryItemBase> items)
@@ -518,7 +524,9 @@ namespace OpenSim.Services.Connectors
518 { 524 {
519 InventoryItemBase retrieved = null; 525 InventoryItemBase retrieved = null;
520 if (m_ItemCache.TryGetValue(item.ID, out retrieved)) 526 if (m_ItemCache.TryGetValue(item.ID, out retrieved))
527 {
521 return retrieved; 528 return retrieved;
529 }
522 530
523 try 531 try
524 { 532 {