From cfd9cf7b18331a9d2117294f6ba23dd03a9423a1 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 25 Aug 2009 06:17:36 -0700 Subject: [PATCH] Closed the web request and stream in SynchronousRestSessionObjectPoster -- maybe this is the cause of some timeouts seen in some monos? --- OpenSim/Framework/Servers/HttpServer/RestSessionService.cs | 3 +++ .../Connectors/Inventory/InventoryServiceConnector.cs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index ec2f9ec1fa..2ef4a36855 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs @@ -75,6 +75,7 @@ namespace OpenSim.Framework.Servers.HttpServer WebRequest request = WebRequest.Create(requestUrl); request.Method = verb; request.ContentType = "text/xml"; + request.Timeout = 20000; MemoryStream buffer = new MemoryStream(); @@ -98,7 +99,9 @@ namespace OpenSim.Framework.Servers.HttpServer { XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream()); + resp.Close(); } + requestStream.Close(); return deserial; } } diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 423ca75557..a2261ba0f4 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs @@ -229,6 +229,11 @@ namespace OpenSim.Services.Connectors return SynchronousRestSessionObjectPoster.BeginPostObject( "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); } + catch (TimeoutException e) + { + m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation to {0} timed out {0} {1}.", m_ServerURI, + e.Source, e.Message); + } catch (Exception e) { // Maybe we're talking to an old inventory server. Try this other thing.