aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
index a0d4008..85622a1 100644
--- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
+++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
@@ -66,8 +66,20 @@ namespace OpenSim.Framework.Servers.HttpServer
66 length = (int)obj.Length; 66 length = (int)obj.Length;
67 request.ContentLength = length; 67 request.ContentLength = length;
68 68
69 Stream requestStream = request.GetRequestStream(); 69 Stream requestStream = null;
70 requestStream.Write(buffer.ToArray(), 0, length); 70 try
71 {
72 requestStream = request.GetRequestStream();
73 requestStream.Write(buffer.ToArray(), 0, length);
74 }
75 catch
76 {
77 }
78 finally
79 {
80 if (requestStream != null)
81 requestStream.Close();
82 }
71 } 83 }
72 84
73 string respstring = String.Empty; 85 string respstring = String.Empty;
@@ -78,9 +90,20 @@ namespace OpenSim.Framework.Servers.HttpServer
78 { 90 {
79 if (resp.ContentLength > 0) 91 if (resp.ContentLength > 0)
80 { 92 {
81 using (StreamReader reader = new StreamReader(resp.GetResponseStream())) 93 Stream respStream = null;
94 try
95 {
96 respStream = resp.GetResponseStream();
97 using (StreamReader reader = new StreamReader(respStream))
98 {
99 respstring = reader.ReadToEnd();
100 }
101 }
102 catch { }
103 finally
82 { 104 {
83 respstring = reader.ReadToEnd(); 105 if (respStream != null)
106 respStream.Close();
84 } 107 }
85 } 108 }
86 } 109 }