cosmetics
parent
8da733c485
commit
4bf4c76a64
|
@ -404,25 +404,12 @@ namespace OpenSim.Framework
|
|||
{
|
||||
await dst.WriteAsync(src, 0, src.Length).ConfigureAwait(false);
|
||||
}
|
||||
_response = (HttpWebResponse)await _request.GetResponseAsync().ConfigureAwait(false);
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
m_log.WarnFormat("[REST]: Request {0} {1} failed with status {2} and message {3}",
|
||||
RequestMethod, _request.RequestUri, e.Status, e.Message);
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[REST]: Request {0} {1} failed with exception {2} {3}",
|
||||
RequestMethod, _request.RequestUri, e.Message, e.StackTrace);
|
||||
return;
|
||||
}
|
||||
|
||||
using(HttpWebResponse response = (HttpWebResponse)await _request.GetResponseAsync().ConfigureAwait(false))
|
||||
{
|
||||
if (WebUtil.DebugLevel >= 5)
|
||||
{
|
||||
using (Stream responseStream = _response.GetResponseStream())
|
||||
using (Stream responseStream = response.GetResponseStream())
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(responseStream))
|
||||
{
|
||||
|
@ -431,9 +418,20 @@ namespace OpenSim.Framework
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_response != null)
|
||||
_response.Close();
|
||||
}
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
m_log.WarnFormat("[REST]: AsyncPOST {0} failed with status {1} and message {2}",
|
||||
_request.RequestUri, e.Status, e.Message);
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[REST]: AsyncPOST {0} failed with exception {1} {2}",
|
||||
_request.RequestUri, e.Message, e.StackTrace);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#region Async Invocation
|
||||
|
|
Loading…
Reference in New Issue