enclose GetRequestStream on try/catch

0.9.0-post-fixes
UbitUmarov 2017-05-28 23:51:13 +01:00
parent 687c01b29e
commit 99111e5052
1 changed files with 15 additions and 14 deletions

View File

@ -428,22 +428,23 @@ namespace OpenSim.Framework
if (WebUtil.DebugLevel >= 5) if (WebUtil.DebugLevel >= 5)
WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src); WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src);
using (Stream dst = _request.GetRequestStream())
{
m_log.Debug("[REST]: GetRequestStream is ok");
byte[] buf = new byte[1024];
int length = src.Read(buf, 0, 1024);
m_log.Debug("[REST]: First Read is ok");
while (length > 0)
{
dst.Write(buf, 0, length);
length = src.Read(buf, 0, 1024);
}
}
try try
{ {
using (Stream dst = _request.GetRequestStream())
{
m_log.Debug("[REST]: GetRequestStream is ok");
byte[] buf = new byte[1024];
int length = src.Read(buf, 0, 1024);
m_log.Debug("[REST]: First Read is ok");
while (length > 0)
{
dst.Write(buf, 0, length);
length = src.Read(buf, 0, 1024);
}
}
_response = (HttpWebResponse)_request.GetResponse(); _response = (HttpWebResponse)_request.GetResponse();
} }
catch (WebException e) catch (WebException e)