diff options
author | UbitUmarov | 2017-05-28 23:51:13 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-28 23:51:13 +0100 |
commit | 99111e50520860477a84620b3033b4d5d6a2c750 (patch) | |
tree | 9cec0fb4f77b7cbbb898a7a5ae153c8a5409c95c | |
parent | need to delay even more agent close after teleport to compensate for slow ma... (diff) | |
download | opensim-SC_OLD-99111e50520860477a84620b3033b4d5d6a2c750.zip opensim-SC_OLD-99111e50520860477a84620b3033b4d5d6a2c750.tar.gz opensim-SC_OLD-99111e50520860477a84620b3033b4d5d6a2c750.tar.bz2 opensim-SC_OLD-99111e50520860477a84620b3033b4d5d6a2c750.tar.xz |
enclose GetRequestStream on try/catch
-rw-r--r-- | OpenSim/Framework/RestClient.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Framework/RestClient.cs b/OpenSim/Framework/RestClient.cs index 0166d9d..ac394fb 100644 --- a/OpenSim/Framework/RestClient.cs +++ b/OpenSim/Framework/RestClient.cs | |||
@@ -428,22 +428,23 @@ namespace OpenSim.Framework | |||
428 | if (WebUtil.DebugLevel >= 5) | 428 | if (WebUtil.DebugLevel >= 5) |
429 | WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src); | 429 | WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src); |
430 | 430 | ||
431 | using (Stream dst = _request.GetRequestStream()) | 431 | |
432 | try | ||
432 | { | 433 | { |
433 | m_log.Debug("[REST]: GetRequestStream is ok"); | 434 | using (Stream dst = _request.GetRequestStream()) |
434 | |||
435 | byte[] buf = new byte[1024]; | ||
436 | int length = src.Read(buf, 0, 1024); | ||
437 | m_log.Debug("[REST]: First Read is ok"); | ||
438 | while (length > 0) | ||
439 | { | 435 | { |
440 | dst.Write(buf, 0, length); | 436 | m_log.Debug("[REST]: GetRequestStream is ok"); |
441 | length = src.Read(buf, 0, 1024); | 437 | |
438 | byte[] buf = new byte[1024]; | ||
439 | int length = src.Read(buf, 0, 1024); | ||
440 | m_log.Debug("[REST]: First Read is ok"); | ||
441 | while (length > 0) | ||
442 | { | ||
443 | dst.Write(buf, 0, length); | ||
444 | length = src.Read(buf, 0, 1024); | ||
445 | } | ||
442 | } | 446 | } |
443 | } | ||
444 | 447 | ||
445 | try | ||
446 | { | ||
447 | _response = (HttpWebResponse)_request.GetResponse(); | 448 | _response = (HttpWebResponse)_request.GetResponse(); |
448 | } | 449 | } |
449 | catch (WebException e) | 450 | catch (WebException e) |