diff options
author | Diva Canto | 2009-10-03 08:33:19 -0700 |
---|---|---|
committer | Diva Canto | 2009-10-03 08:33:19 -0700 |
commit | 4843edfeb7a4af37125c9916350e5cd1a2e2ba7c (patch) | |
tree | 891252eb606fe39be1a6401dea2637eb20e7ff68 | |
parent | Small permissions tweak (diff) | |
download | opensim-SC-4843edfeb7a4af37125c9916350e5cd1a2e2ba7c.zip opensim-SC-4843edfeb7a4af37125c9916350e5cd1a2e2ba7c.tar.gz opensim-SC-4843edfeb7a4af37125c9916350e5cd1a2e2ba7c.tar.bz2 opensim-SC-4843edfeb7a4af37125c9916350e5cd1a2e2ba7c.tar.xz |
Closing more streams.
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | 31 |
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 | } |