aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/RestClient.cs25
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)