Merge branch 'diva-textures-osgrid' of ssh://opensimulator.org/var/git/opensim into diva-textures-osgrid

prioritization
John Hurliman 2009-10-02 16:54:03 -07:00
commit 3ab6c89652
1 changed files with 20 additions and 6 deletions

View File

@ -91,24 +91,31 @@ namespace OpenSim.Framework.Servers.HttpServer
Stream requestStream = request.EndGetRequestStream(res); Stream requestStream = request.EndGetRequestStream(res);
requestStream.Write(buffer.ToArray(), 0, length); requestStream.Write(buffer.ToArray(), 0, length);
requestStream.Close();
request.BeginGetResponse(delegate(IAsyncResult ar) request.BeginGetResponse(delegate(IAsyncResult ar)
{ {
response = request.EndGetResponse(ar); response = request.EndGetResponse(ar);
Stream respStream = null;
try try
{ {
deserial = (TResponse) deserializer.Deserialize( respStream = response.GetResponseStream();
response.GetResponseStream()); deserial = (TResponse)deserializer.Deserialize(
respStream);
} }
catch (System.InvalidOperationException) catch (System.InvalidOperationException)
{ {
} }
finally
{
respStream.Close();
response.Close();
}
action(deserial); action(deserial);
}, null); }, null);
}, null); }, null);
return; return;
} }
@ -119,14 +126,21 @@ namespace OpenSim.Framework.Servers.HttpServer
// If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
// documented in MSDN // documented in MSDN
response = request.EndGetResponse(res2); response = request.EndGetResponse(res2);
Stream respStream = null;
try try
{ {
deserial = (TResponse)deserializer.Deserialize(response.GetResponseStream()); respStream = response.GetResponseStream();
deserial = (TResponse)deserializer.Deserialize(respStream);
} }
catch (System.InvalidOperationException) catch (System.InvalidOperationException)
{ {
} }
finally
{
respStream.Close();
response.Close();
}
} }
catch (WebException e) catch (WebException e)
{ {