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.

0.8.2-post-fixes
Diva Canto 2015-09-11 09:48:51 -07:00
parent 45046858a1
commit 29aaf5564f
2 changed files with 16 additions and 6 deletions

View File

@ -319,12 +319,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
m_asset.Description = item.Description;
m_asset.Type = (sbyte)item.AssetType;
// We must always store the item at this point even if the asset hasn't finished uploading, in order
// to avoid a race condition when the appearance module retrieves the item to set the asset id in
// the AvatarAppearance structure.
item.AssetID = m_asset.FullID;
if (item.AssetID != UUID.Zero)
if (m_asset.FullID != UUID.Zero)
{
// We must always store the item at this point even if the asset hasn't finished uploading, in order
// to avoid a race condition when the appearance module retrieves the item to set the asset id in
// the AvatarAppearance structure.
item.AssetID = m_asset.FullID;
m_Scene.InventoryService.UpdateItem(item);
}
if (m_uploadState == UploadState.Complete)
{

View File

@ -474,7 +474,13 @@ namespace OpenSim.Services.Connectors
{ "CreationDate", item.CreationDate.ToString() }
});
return CheckReturn(ret);
bool result = CheckReturn(ret);
if (result)
{
m_ItemCache.AddOrUpdate(item.ID, item, CACHE_EXPIRATION_SECONDS);
}
return result;
}
public bool MoveItems(UUID principalID, List<InventoryItemBase> items)
@ -518,7 +524,9 @@ namespace OpenSim.Services.Connectors
{
InventoryItemBase retrieved = null;
if (m_ItemCache.TryGetValue(item.ID, out retrieved))
{
return retrieved;
}
try
{