Closing more streams.
parent
b4d1cf0009
commit
4843edfeb7
|
@ -66,9 +66,21 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
length = (int)obj.Length;
|
length = (int)obj.Length;
|
||||||
request.ContentLength = length;
|
request.ContentLength = length;
|
||||||
|
|
||||||
Stream requestStream = request.GetRequestStream();
|
Stream requestStream = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
requestStream = request.GetRequestStream();
|
||||||
requestStream.Write(buffer.ToArray(), 0, length);
|
requestStream.Write(buffer.ToArray(), 0, length);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (requestStream != null)
|
||||||
|
requestStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string respstring = String.Empty;
|
string respstring = String.Empty;
|
||||||
|
|
||||||
|
@ -78,11 +90,22 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
{
|
{
|
||||||
if (resp.ContentLength > 0)
|
if (resp.ContentLength > 0)
|
||||||
{
|
{
|
||||||
using (StreamReader reader = new StreamReader(resp.GetResponseStream()))
|
Stream respStream = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
respStream = resp.GetResponseStream();
|
||||||
|
using (StreamReader reader = new StreamReader(respStream))
|
||||||
{
|
{
|
||||||
respstring = reader.ReadToEnd();
|
respstring = reader.ReadToEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (respStream != null)
|
||||||
|
respStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (System.InvalidOperationException)
|
catch (System.InvalidOperationException)
|
||||||
|
|
Loading…
Reference in New Issue