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.
parent
45046858a1
commit
29aaf5564f
|
@ -319,12 +319,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
|||
m_asset.Description = item.Description;
|
||||
m_asset.Type = (sbyte)item.AssetType;
|
||||
|
||||
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;
|
||||
if (item.AssetID != UUID.Zero)
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
}
|
||||
|
||||
if (m_uploadState == UploadState.Complete)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue