Closed the web request and stream in SynchronousRestSessionObjectPoster -- maybe this is the cause of some timeouts seen in some monos?

remotes/origin/0.6.7-post-fixes
Diva Canto 2009-08-25 06:17:36 -07:00
parent 1e4238af92
commit cfd9cf7b18
2 changed files with 8 additions and 0 deletions

View File

@ -75,6 +75,7 @@ namespace OpenSim.Framework.Servers.HttpServer
WebRequest request = WebRequest.Create(requestUrl); WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb; request.Method = verb;
request.ContentType = "text/xml"; request.ContentType = "text/xml";
request.Timeout = 20000;
MemoryStream buffer = new MemoryStream(); MemoryStream buffer = new MemoryStream();
@ -98,7 +99,9 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream()); deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream());
resp.Close();
} }
requestStream.Close();
return deserial; return deserial;
} }
} }

View File

@ -229,6 +229,11 @@ namespace OpenSim.Services.Connectors
return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject( return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject(
"POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); "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) catch (Exception e)
{ {
// Maybe we're talking to an old inventory server. Try this other thing. // Maybe we're talking to an old inventory server. Try this other thing.