diff options
Diffstat (limited to 'OpenSim/ConsoleClient')
-rw-r--r-- | OpenSim/ConsoleClient/Requester.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/ConsoleClient/Requester.cs b/OpenSim/ConsoleClient/Requester.cs index aabb02c..0a21328 100644 --- a/OpenSim/ConsoleClient/Requester.cs +++ b/OpenSim/ConsoleClient/Requester.cs | |||
@@ -44,7 +44,6 @@ namespace OpenSim.ConsoleClient | |||
44 | ReplyDelegate action) | 44 | ReplyDelegate action) |
45 | { | 45 | { |
46 | WebRequest request = WebRequest.Create(requestUrl); | 46 | WebRequest request = WebRequest.Create(requestUrl); |
47 | WebResponse response = null; | ||
48 | 47 | ||
49 | request.Method = "POST"; | 48 | request.Method = "POST"; |
50 | 49 | ||
@@ -64,16 +63,18 @@ namespace OpenSim.ConsoleClient | |||
64 | { | 63 | { |
65 | string reply = String.Empty; | 64 | string reply = String.Empty; |
66 | 65 | ||
67 | response = request.EndGetResponse(ar); | 66 | using (WebResponse response = request.EndGetResponse(ar)) |
68 | |||
69 | try | ||
70 | { | 67 | { |
71 | StreamReader r = new StreamReader(response.GetResponseStream()); | 68 | try |
72 | reply = r.ReadToEnd(); | 69 | { |
70 | using (Stream s = response.GetResponseStream()) | ||
71 | using (StreamReader r = new StreamReader(s)) | ||
72 | reply = r.ReadToEnd(); | ||
73 | 73 | ||
74 | } | 74 | } |
75 | catch (System.InvalidOperationException) | 75 | catch (System.InvalidOperationException) |
76 | { | 76 | { |
77 | } | ||
77 | } | 78 | } |
78 | 79 | ||
79 | action(requestUrl, data, reply); | 80 | action(requestUrl, data, reply); |