mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Formatting cleanup.
This commit is contained in:
@@ -249,11 +249,11 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
//m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId);
|
||||
|
||||
|
||||
// Xantor 20080526:
|
||||
// Xantor 20080526:
|
||||
// if a request is made for an asset which is not in the cache yet, but has already been requested by
|
||||
// something else, queue up the callbacks on that requestor instead of swamping the assetserver
|
||||
// something else, queue up the callbacks on that requestor instead of swamping the assetserver
|
||||
// with multiple requests for the same asset.
|
||||
|
||||
|
||||
AssetBase asset;
|
||||
|
||||
if (TryGetCachedAsset(assetId, out asset))
|
||||
@@ -265,8 +265,8 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
#if DEBUG
|
||||
// m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
NewAssetRequest req = new NewAssetRequest(assetId, callback);
|
||||
AssetRequestsList requestList;
|
||||
|
||||
@@ -499,7 +499,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
Assets[assetID] = null;
|
||||
}
|
||||
|
||||
|
||||
// Notify requesters for this asset
|
||||
AssetRequestsList reqList = null;
|
||||
lock (RequestLists)
|
||||
@@ -590,20 +590,20 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
RequestedAssets.Add(requestID, request);
|
||||
m_assetServer.RequestAsset(requestID, false);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// It has an entry in our cache
|
||||
AssetInfo asset = Assets[requestID];
|
||||
|
||||
|
||||
// FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
|
||||
if (null == asset)
|
||||
{
|
||||
//m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// The asset is knosn to exist and is in our cache, so add it to the AssetRequests list
|
||||
AssetRequest req = new AssetRequest();
|
||||
req.RequestUser = userInfo;
|
||||
|
||||
@@ -485,10 +485,10 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
if (HasInventory)
|
||||
{
|
||||
if(item.Folder == LLUUID.Zero)
|
||||
if (item.Folder == LLUUID.Zero)
|
||||
{
|
||||
InventoryFolderImpl f=FindFolderForType(item.AssetType);
|
||||
if(f != null)
|
||||
if (f != null)
|
||||
item.Folder=f.ID;
|
||||
else
|
||||
item.Folder=RootFolder.ID;
|
||||
@@ -617,14 +617,14 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
|
||||
private InventoryFolderImpl FindFolderForType(int type)
|
||||
{
|
||||
if(RootFolder == null)
|
||||
if (RootFolder == null)
|
||||
return null;
|
||||
|
||||
lock(RootFolder.SubFolders)
|
||||
lock (RootFolder.SubFolders)
|
||||
{
|
||||
foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values)
|
||||
{
|
||||
if(f.Type == type)
|
||||
if (f.Type == type)
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,19 +310,20 @@ namespace OpenSim.Framework.Servers
|
||||
agentHandler = null;
|
||||
try
|
||||
{
|
||||
foreach(IHttpAgentHandler handler in m_agentHandlers.Values)
|
||||
foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
|
||||
{
|
||||
if(handler.Match(request, response))
|
||||
if (handler.Match(request, response))
|
||||
{
|
||||
agentHandler = handler;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(KeyNotFoundException) {}
|
||||
catch(KeyNotFoundException)
|
||||
{
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -478,7 +479,6 @@ namespace OpenSim.Framework.Servers
|
||||
|
||||
private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response)
|
||||
{
|
||||
|
||||
// In the case of REST, then handler is responsible for ALL aspects of
|
||||
// the request/response handling. Nothing is done here, not even encoding.
|
||||
|
||||
@@ -500,11 +500,12 @@ namespace OpenSim.Framework.Servers
|
||||
response.StatusCode = (int)OSHttpStatusCode.ServerErrorInternalError;
|
||||
response.OutputStream.Close();
|
||||
}
|
||||
catch(Exception){}
|
||||
catch(Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response)
|
||||
@@ -759,13 +760,16 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
try
|
||||
{
|
||||
if(handler == m_agentHandlers[agent])
|
||||
if (handler == m_agentHandlers[agent])
|
||||
{
|
||||
m_agentHandlers.Remove(agent);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch(KeyNotFoundException) {}
|
||||
catch(KeyNotFoundException)
|
||||
{
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user