diff options
author | Melanie | 2009-10-05 10:17:23 +0100 |
---|---|---|
committer | Melanie | 2009-10-05 10:17:23 +0100 |
commit | 0744292b479446eb1ebec828afafacc0189709ca (patch) | |
tree | 3c43b5f425aff61d3625b75b7aef35ce5062ae56 /OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | |
parent | Merge branch 'master' into vehicles (diff) | |
parent | Make the asset connector async Get overload return false if the asset (diff) | |
download | opensim-SC-0744292b479446eb1ebec828afafacc0189709ca.zip opensim-SC-0744292b479446eb1ebec828afafacc0189709ca.tar.gz opensim-SC-0744292b479446eb1ebec828afafacc0189709ca.tar.bz2 opensim-SC-0744292b479446eb1ebec828afafacc0189709ca.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index a0d4008..8a490f7 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | |||
@@ -66,8 +66,23 @@ 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 | // Let's not close this | ||
83 | //buffer.Close(); | ||
84 | |||
85 | } | ||
71 | } | 86 | } |
72 | 87 | ||
73 | string respstring = String.Empty; | 88 | string respstring = String.Empty; |
@@ -78,9 +93,20 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
78 | { | 93 | { |
79 | if (resp.ContentLength > 0) | 94 | if (resp.ContentLength > 0) |
80 | { | 95 | { |
81 | using (StreamReader reader = new StreamReader(resp.GetResponseStream())) | 96 | Stream respStream = null; |
97 | try | ||
98 | { | ||
99 | respStream = resp.GetResponseStream(); | ||
100 | using (StreamReader reader = new StreamReader(respStream)) | ||
101 | { | ||
102 | respstring = reader.ReadToEnd(); | ||
103 | } | ||
104 | } | ||
105 | catch { } | ||
106 | finally | ||
82 | { | 107 | { |
83 | respstring = reader.ReadToEnd(); | 108 | if (respStream != null) |
109 | respStream.Close(); | ||
84 | } | 110 | } |
85 | } | 111 | } |
86 | } | 112 | } |