* Refactored some asset code and in the process uncovered a bug; now, I think first transfer of asset should start faster.

ThreadPoolClientBranch
lbsa71 2008-02-09 22:23:36 +00:00
parent d2e66872ed
commit 7486762aa0
1 changed files with 16 additions and 12 deletions

View File

@ -81,6 +81,9 @@ namespace OpenSim.Framework.Communications.Cache
long imageBytes = 0; long imageBytes = 0;
long assetBytes = 0; long assetBytes = 0;
foreach (TextureImage texture in Textures.Values) foreach (TextureImage texture in Textures.Values)
{ {
if (texture.Temporary) if (texture.Temporary)
@ -201,22 +204,23 @@ namespace OpenSim.Framework.Communications.Cache
else else
{ {
NewAssetRequest req = new NewAssetRequest(assetID, callback); NewAssetRequest req = new NewAssetRequest(assetID, callback);
if (RequestLists.ContainsKey(assetID))
AssetRequestsList requestList;
lock (RequestLists)
{ {
lock (RequestLists) if (RequestLists.TryGetValue(assetID, out requestList))
{ {
RequestLists[assetID].Requests.Add(req); }
} else
} {
else requestList = new AssetRequestsList(assetID);
{ RequestLists.Add(assetID, requestList);
AssetRequestsList reqList = new AssetRequestsList(assetID);
reqList.Requests.Add(req);
lock (RequestLists)
{
RequestLists.Add(assetID, reqList);
} }
} }
requestList.Requests.Add(req);
m_assetServer.RequestAsset(assetID, false); m_assetServer.RequestAsset(assetID, false);
} }
} }