More streams closed.
parent
de94aa9bb5
commit
df7049008a
|
@ -88,6 +88,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
serializer.Serialize(writer, sobj);
|
serializer.Serialize(writer, sobj);
|
||||||
writer.Flush();
|
writer.Flush();
|
||||||
}
|
}
|
||||||
|
buffer.Close();
|
||||||
|
|
||||||
int length = (int)buffer.Length;
|
int length = (int)buffer.Length;
|
||||||
request.ContentLength = length;
|
request.ContentLength = length;
|
||||||
|
@ -99,8 +100,19 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
using (WebResponse resp = request.GetResponse())
|
using (WebResponse resp = request.GetResponse())
|
||||||
{
|
{
|
||||||
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
||||||
deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream());
|
Stream respStream = null;
|
||||||
resp.Close();
|
try
|
||||||
|
{
|
||||||
|
respStream = resp.GetResponseStream();
|
||||||
|
deserial = (TResponse)deserializer.Deserialize(respStream);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (respStream != null)
|
||||||
|
respStream.Close();
|
||||||
|
resp.Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return deserial;
|
return deserial;
|
||||||
}
|
}
|
||||||
|
@ -140,6 +152,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
serializer.Serialize(writer, sobj);
|
serializer.Serialize(writer, sobj);
|
||||||
writer.Flush();
|
writer.Flush();
|
||||||
}
|
}
|
||||||
|
buffer.Close();
|
||||||
|
|
||||||
int length = (int)buffer.Length;
|
int length = (int)buffer.Length;
|
||||||
request.ContentLength = length;
|
request.ContentLength = length;
|
||||||
|
@ -165,6 +178,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
// m_log.DebugFormat("[REST OBJECT POSTER RESPONSE]: Received {0}", reader.ReadToEnd());
|
// m_log.DebugFormat("[REST OBJECT POSTER RESPONSE]: Received {0}", reader.ReadToEnd());
|
||||||
|
|
||||||
deserial = (TResponse)deserializer.Deserialize(stream);
|
deserial = (TResponse)deserializer.Deserialize(stream);
|
||||||
|
if (stream != null)
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
if (deserial != null && ResponseCallback != null)
|
if (deserial != null && ResponseCallback != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
writer.Write(obj);
|
writer.Write(obj);
|
||||||
writer.Flush();
|
writer.Flush();
|
||||||
}
|
}
|
||||||
|
buffer.Close();
|
||||||
|
|
||||||
length = (int)obj.Length;
|
length = (int)obj.Length;
|
||||||
request.ContentLength = length;
|
request.ContentLength = length;
|
||||||
|
|
Loading…
Reference in New Issue