* Properly guard removal of asset request lists on AssetCache.AssetNotFound (my own bug)

ThreadPoolClientBranch
Justin Clarke Casey 2008-02-20 19:13:59 +00:00
parent 53d5aeec24
commit f3190810d3
2 changed files with 16 additions and 14 deletions

View File

@ -44,8 +44,8 @@ namespace OpenSim.Framework.Communications.Cache
///
/// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either
/// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and
/// sends packetised data directly back to the client. The only point where they meets is AssetReceived() and
/// AssetNotFound().
/// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and
/// AssetNotFound(), which means they do share the same asset and texture caches.
///
/// TODO Assets in this cache are effectively immortal (they are never disposed off through old age).
/// This is not a huge problem at the moment since other memory use usually dwarfs that used by assets
@ -469,7 +469,7 @@ namespace OpenSim.Framework.Communications.Cache
// Notify requesters for this asset
if (RequestLists.ContainsKey(asset.FullID))
{
{
lock (RequestLists)
{
AssetRequestsList reqList = RequestLists[asset.FullID];
@ -513,14 +513,16 @@ namespace OpenSim.Framework.Communications.Cache
// Notify requesters for this asset
lock (RequestLists)
{
AssetRequestsList reqList = RequestLists[assetID];
foreach (NewAssetRequest req in reqList.Requests)
if (RequestLists.ContainsKey(assetID))
{
req.Callback(assetID, null);
AssetRequestsList reqList = RequestLists[assetID];
foreach (NewAssetRequest req in reqList.Requests)
{
req.Callback(assetID, null);
}
RequestLists.Remove(assetID);
}
RequestLists.Remove(assetID);
reqList.Requests.Clear();
}
}

View File

@ -77,7 +77,7 @@ namespace OpenSim.Framework.Communications.Cache
}
else
{
m_log.ErrorFormat("[ASSETSERVER]: Asset {0} not found by asset server", req.AssetID);
m_log.ErrorFormat("[ASSET SERVER]: Asset {0} not found by asset server", req.AssetID);
m_receiver.AssetNotFound(req.AssetID);
}
@ -85,7 +85,7 @@ namespace OpenSim.Framework.Communications.Cache
public virtual void LoadDefaultAssets()
{
m_log.Info("[ASSETSERVER]: Setting up asset database");
m_log.Info("[ASSET SERVER]: Setting up asset database");
assetLoader.ForEachDefaultXmlAsset(StoreAsset);
@ -94,7 +94,7 @@ namespace OpenSim.Framework.Communications.Cache
public AssetServerBase()
{
m_log.Info("[ASSETSERVER]: Starting asset storage system");
m_log.Info("[ASSET SERVER]: Starting asset storage system");
m_assetRequests = new BlockingQueue<AssetRequest>();
m_localAssetServerThread = new Thread(RunRequests);
@ -115,7 +115,7 @@ namespace OpenSim.Framework.Communications.Cache
}
catch (Exception e)
{
m_log.Error("[ASSETSERVER]: " + e.Message);
m_log.Error("[ASSET SERVER]: " + e.ToString());
}
}
}
@ -136,7 +136,7 @@ namespace OpenSim.Framework.Communications.Cache
req.IsTexture = isTexture;
m_assetRequests.Enqueue(req);
m_log.InfoFormat("[ASSETSERVER]: Added {0} to request queue", assetID);
m_log.InfoFormat("[ASSET SERVER]: Added {0} to request queue", assetID);
}
public virtual void UpdateAsset(AssetBase asset)