enclose GetRequestStream on try/catch
parent
687c01b29e
commit
99111e5052
|
@ -428,22 +428,23 @@ namespace OpenSim.Framework
|
|||
if (WebUtil.DebugLevel >= 5)
|
||||
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
|
||||
{
|
||||
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();
|
||||
}
|
||||
catch (WebException e)
|
||||
|
|
Loading…
Reference in New Issue