diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 22 |
3 files changed, 28 insertions, 24 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index feac65a..dcb7d73 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -249,11 +249,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
249 | //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); | 249 | //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); |
250 | 250 | ||
251 | 251 | ||
252 | // Xantor 20080526: | 252 | // Xantor 20080526: |
253 | // if a request is made for an asset which is not in the cache yet, but has already been requested by | 253 | // if a request is made for an asset which is not in the cache yet, but has already been requested by |
254 | // something else, queue up the callbacks on that requestor instead of swamping the assetserver | 254 | // something else, queue up the callbacks on that requestor instead of swamping the assetserver |
255 | // with multiple requests for the same asset. | 255 | // with multiple requests for the same asset. |
256 | 256 | ||
257 | AssetBase asset; | 257 | AssetBase asset; |
258 | 258 | ||
259 | if (TryGetCachedAsset(assetId, out asset)) | 259 | if (TryGetCachedAsset(assetId, out asset)) |
@@ -265,8 +265,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
265 | #if DEBUG | 265 | #if DEBUG |
266 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); | 266 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); |
267 | #endif | 267 | #endif |
268 | 268 | ||
269 | 269 | ||
270 | NewAssetRequest req = new NewAssetRequest(assetId, callback); | 270 | NewAssetRequest req = new NewAssetRequest(assetId, callback); |
271 | AssetRequestsList requestList; | 271 | AssetRequestsList requestList; |
272 | 272 | ||
@@ -499,7 +499,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
499 | { | 499 | { |
500 | Assets[assetID] = null; | 500 | Assets[assetID] = null; |
501 | } | 501 | } |
502 | 502 | ||
503 | // Notify requesters for this asset | 503 | // Notify requesters for this asset |
504 | AssetRequestsList reqList = null; | 504 | AssetRequestsList reqList = null; |
505 | lock (RequestLists) | 505 | lock (RequestLists) |
@@ -590,20 +590,20 @@ namespace OpenSim.Framework.Communications.Cache | |||
590 | RequestedAssets.Add(requestID, request); | 590 | RequestedAssets.Add(requestID, request); |
591 | m_assetServer.RequestAsset(requestID, false); | 591 | m_assetServer.RequestAsset(requestID, false); |
592 | } | 592 | } |
593 | 593 | ||
594 | return; | 594 | return; |
595 | } | 595 | } |
596 | 596 | ||
597 | // It has an entry in our cache | 597 | // It has an entry in our cache |
598 | AssetInfo asset = Assets[requestID]; | 598 | AssetInfo asset = Assets[requestID]; |
599 | 599 | ||
600 | // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right. | 600 | // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right. |
601 | if (null == asset) | 601 | if (null == asset) |
602 | { | 602 | { |
603 | //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID); | 603 | //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID); |
604 | return; | 604 | return; |
605 | } | 605 | } |
606 | 606 | ||
607 | // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list | 607 | // The asset is knosn to exist and is in our cache, so add it to the AssetRequests list |
608 | AssetRequest req = new AssetRequest(); | 608 | AssetRequest req = new AssetRequest(); |
609 | req.RequestUser = userInfo; | 609 | req.RequestUser = userInfo; |
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 1cbffc7..b98cec7 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -485,10 +485,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
485 | { | 485 | { |
486 | if (HasInventory) | 486 | if (HasInventory) |
487 | { | 487 | { |
488 | if(item.Folder == LLUUID.Zero) | 488 | if (item.Folder == LLUUID.Zero) |
489 | { | 489 | { |
490 | InventoryFolderImpl f=FindFolderForType(item.AssetType); | 490 | InventoryFolderImpl f=FindFolderForType(item.AssetType); |
491 | if(f != null) | 491 | if (f != null) |
492 | item.Folder=f.ID; | 492 | item.Folder=f.ID; |
493 | else | 493 | else |
494 | item.Folder=RootFolder.ID; | 494 | item.Folder=RootFolder.ID; |
@@ -617,14 +617,14 @@ namespace OpenSim.Framework.Communications.Cache | |||
617 | 617 | ||
618 | private InventoryFolderImpl FindFolderForType(int type) | 618 | private InventoryFolderImpl FindFolderForType(int type) |
619 | { | 619 | { |
620 | if(RootFolder == null) | 620 | if (RootFolder == null) |
621 | return null; | 621 | return null; |
622 | 622 | ||
623 | lock(RootFolder.SubFolders) | 623 | lock (RootFolder.SubFolders) |
624 | { | 624 | { |
625 | foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values) | 625 | foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values) |
626 | { | 626 | { |
627 | if(f.Type == type) | 627 | if (f.Type == type) |
628 | return f; | 628 | return f; |
629 | } | 629 | } |
630 | } | 630 | } |
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index fa64b41..50e2c0c 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -310,19 +310,20 @@ namespace OpenSim.Framework.Servers | |||
310 | agentHandler = null; | 310 | agentHandler = null; |
311 | try | 311 | try |
312 | { | 312 | { |
313 | foreach(IHttpAgentHandler handler in m_agentHandlers.Values) | 313 | foreach (IHttpAgentHandler handler in m_agentHandlers.Values) |
314 | { | 314 | { |
315 | if(handler.Match(request, response)) | 315 | if (handler.Match(request, response)) |
316 | { | 316 | { |
317 | agentHandler = handler; | 317 | agentHandler = handler; |
318 | return true; | 318 | return true; |
319 | } | 319 | } |
320 | } | 320 | } |
321 | } | 321 | } |
322 | catch(KeyNotFoundException) {} | 322 | catch(KeyNotFoundException) |
323 | { | ||
324 | } | ||
323 | 325 | ||
324 | return false; | 326 | return false; |
325 | |||
326 | } | 327 | } |
327 | 328 | ||
328 | /// <summary> | 329 | /// <summary> |
@@ -478,7 +479,6 @@ namespace OpenSim.Framework.Servers | |||
478 | 479 | ||
479 | private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response) | 480 | private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response) |
480 | { | 481 | { |
481 | |||
482 | // In the case of REST, then handler is responsible for ALL aspects of | 482 | // In the case of REST, then handler is responsible for ALL aspects of |
483 | // the request/response handling. Nothing is done here, not even encoding. | 483 | // the request/response handling. Nothing is done here, not even encoding. |
484 | 484 | ||
@@ -500,11 +500,12 @@ namespace OpenSim.Framework.Servers | |||
500 | response.StatusCode = (int)OSHttpStatusCode.ServerErrorInternalError; | 500 | response.StatusCode = (int)OSHttpStatusCode.ServerErrorInternalError; |
501 | response.OutputStream.Close(); | 501 | response.OutputStream.Close(); |
502 | } | 502 | } |
503 | catch(Exception){} | 503 | catch(Exception) |
504 | { | ||
505 | } | ||
504 | } | 506 | } |
505 | 507 | ||
506 | return true; | 508 | return true; |
507 | |||
508 | } | 509 | } |
509 | 510 | ||
510 | public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response) | 511 | public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response) |
@@ -759,13 +760,16 @@ namespace OpenSim.Framework.Servers | |||
759 | { | 760 | { |
760 | try | 761 | try |
761 | { | 762 | { |
762 | if(handler == m_agentHandlers[agent]) | 763 | if (handler == m_agentHandlers[agent]) |
763 | { | 764 | { |
764 | m_agentHandlers.Remove(agent); | 765 | m_agentHandlers.Remove(agent); |
765 | return true; | 766 | return true; |
766 | } | 767 | } |
767 | } | 768 | } |
768 | catch(KeyNotFoundException) {} | 769 | catch(KeyNotFoundException) |
770 | { | ||
771 | } | ||
772 | |||
769 | return false; | 773 | return false; |
770 | } | 774 | } |
771 | 775 | ||