diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index beeef70..cf4f835 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | |||
@@ -91,7 +91,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
91 | 91 | ||
92 | response.SendChunked = false; | 92 | response.SendChunked = false; |
93 | response.ContentLength64 = buffer.Length; | 93 | response.ContentLength64 = buffer.Length; |
94 | response.ContentEncoding = Encoding.UTF8; | ||
95 | 94 | ||
96 | try | 95 | try |
97 | { | 96 | { |
@@ -118,7 +117,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
118 | { | 117 | { |
119 | int responsecode; | 118 | int responsecode; |
120 | string responseString = String.Empty; | 119 | string responseString = String.Empty; |
121 | byte[] responseData = null; | 120 | byte[] responseBytes = null; |
122 | string contentType; | 121 | string contentType; |
123 | 122 | ||
124 | if (responsedata == null) | 123 | if (responsedata == null) |
@@ -134,8 +133,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
134 | { | 133 | { |
135 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 134 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); |
136 | responsecode = (int)responsedata["int_response_code"]; | 135 | responsecode = (int)responsedata["int_response_code"]; |
136 | |||
137 | if (responsedata["bin_response_data"] != null) | 137 | if (responsedata["bin_response_data"] != null) |
138 | responseData = (byte[])responsedata["bin_response_data"]; | 138 | responseBytes = (byte[])responsedata["bin_response_data"]; |
139 | else | 139 | else |
140 | responseString = (string)responsedata["str_response_string"]; | 140 | responseString = (string)responsedata["str_response_string"]; |
141 | contentType = (string)responsedata["content_type"]; | 141 | contentType = (string)responsedata["content_type"]; |
@@ -170,9 +170,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
170 | if (responsedata.ContainsKey("access_control_allow_origin")) | 170 | if (responsedata.ContainsKey("access_control_allow_origin")) |
171 | response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]); | 171 | response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]); |
172 | 172 | ||
173 | //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this | ||
174 | //and should check for NullReferenceExceptions | ||
175 | |||
176 | if (string.IsNullOrEmpty(contentType)) | 173 | if (string.IsNullOrEmpty(contentType)) |
177 | { | 174 | { |
178 | contentType = "text/html"; | 175 | contentType = "text/html"; |
@@ -185,7 +182,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
185 | if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently) | 182 | if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently) |
186 | { | 183 | { |
187 | response.RedirectLocation = (string)responsedata["str_redirect_location"]; | 184 | response.RedirectLocation = (string)responsedata["str_redirect_location"]; |
188 | response.StatusCode = responsecode; | ||
189 | } | 185 | } |
190 | 186 | ||
191 | response.AddHeader("Content-Type", contentType); | 187 | response.AddHeader("Content-Type", contentType); |
@@ -199,9 +195,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
199 | 195 | ||
200 | byte[] buffer; | 196 | byte[] buffer; |
201 | 197 | ||
202 | if (responseData != null) | 198 | if (responseBytes != null) |
203 | { | 199 | { |
204 | buffer = responseData; | 200 | buffer = responseBytes; |
205 | } | 201 | } |
206 | else | 202 | else |
207 | { | 203 | { |
@@ -218,9 +214,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
218 | // Binary! | 214 | // Binary! |
219 | buffer = Convert.FromBase64String(responseString); | 215 | buffer = Convert.FromBase64String(responseString); |
220 | } | 216 | } |
221 | |||
222 | response.SendChunked = false; | ||
223 | response.ContentLength64 = buffer.Length; | ||
224 | response.ContentEncoding = Encoding.UTF8; | 217 | response.ContentEncoding = Encoding.UTF8; |
225 | } | 218 | } |
226 | 219 | ||