diff options
author | UbitUmarov | 2014-07-23 02:14:15 +0100 |
---|---|---|
committer | UbitUmarov | 2014-07-23 02:14:15 +0100 |
commit | f236b2e5d3f8ba02d3db8ec35d74887723d1ee7b (patch) | |
tree | 9d847912e6392773312ff9ebbffb7d579119a8ee /OpenSim/Framework/Servers/HttpServer | |
parent | clamp avatar standup position within region (diff) | |
download | opensim-SC-f236b2e5d3f8ba02d3db8ec35d74887723d1ee7b.zip opensim-SC-f236b2e5d3f8ba02d3db8ec35d74887723d1ee7b.tar.gz opensim-SC-f236b2e5d3f8ba02d3db8ec35d74887723d1ee7b.tar.bz2 opensim-SC-f236b2e5d3f8ba02d3db8ec35d74887723d1ee7b.tar.xz |
request.DoHTTPGruntWork(..) is now identical to our version, so use
those again, getting code closer to os
again
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 44f7045..21e52ca 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -154,7 +154,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
154 | { | 154 | { |
155 | foreach (PollServiceHttpRequest req in m_retryRequests) | 155 | foreach (PollServiceHttpRequest req in m_retryRequests) |
156 | { | 156 | { |
157 | DoHTTPGruntWork(m_server,req, | 157 | req.DoHTTPGruntWork(m_server, |
158 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 158 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
159 | } | 159 | } |
160 | } | 160 | } |
@@ -176,7 +176,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
176 | try | 176 | try |
177 | { | 177 | { |
178 | wreq = m_requests.Dequeue(0); | 178 | wreq = m_requests.Dequeue(0); |
179 | DoHTTPGruntWork(m_server,wreq, | 179 | wreq.DoHTTPGruntWork(m_server, |
180 | wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); | 180 | wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); |
181 | } | 181 | } |
182 | catch | 182 | catch |
@@ -211,7 +211,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
211 | { | 211 | { |
212 | try | 212 | try |
213 | { | 213 | { |
214 | DoHTTPGruntWork(m_server, req, responsedata); | 214 | req.DoHTTPGruntWork(m_server, responsedata); |
215 | } | 215 | } |
216 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | 216 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream |
217 | { | 217 | { |
@@ -224,7 +224,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
224 | { | 224 | { |
225 | try | 225 | try |
226 | { | 226 | { |
227 | DoHTTPGruntWork(m_server, req, responsedata); | 227 | req.DoHTTPGruntWork(m_server, responsedata); |
228 | } | 228 | } |
229 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | 229 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream |
230 | { | 230 | { |
@@ -239,7 +239,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
239 | { | 239 | { |
240 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 240 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
241 | { | 241 | { |
242 | DoHTTPGruntWork(m_server, req, | 242 | req.DoHTTPGruntWork(m_server, |
243 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 243 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
244 | } | 244 | } |
245 | else | 245 | else |
@@ -256,41 +256,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
256 | } | 256 | } |
257 | } | 257 | } |
258 | 258 | ||
259 | // DoHTTPGruntWork changed, not sending response | ||
260 | // do the same work around as core | ||
261 | |||
262 | internal static void DoHTTPGruntWork(BaseHttpServer server, PollServiceHttpRequest req, Hashtable responsedata) | ||
263 | { | ||
264 | OSHttpResponse response | ||
265 | = new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext); | ||
266 | |||
267 | byte[] buffer = server.DoHTTPGruntWork(responsedata, response); | ||
268 | |||
269 | response.SendChunked = false; | ||
270 | response.ContentLength64 = buffer.Length; | ||
271 | response.ContentEncoding = Encoding.UTF8; | ||
272 | |||
273 | try | ||
274 | { | ||
275 | response.OutputStream.Write(buffer, 0, buffer.Length); | ||
276 | } | ||
277 | catch (Exception ex) | ||
278 | { | ||
279 | m_log.Warn(string.Format("[POLL SERVICE WORKER THREAD]: Error ", ex)); | ||
280 | } | ||
281 | finally | ||
282 | { | ||
283 | try | ||
284 | { | ||
285 | response.OutputStream.Flush(); | ||
286 | response.Send(); | ||
287 | } | ||
288 | catch (Exception e) | ||
289 | { | ||
290 | m_log.Warn(String.Format("[POLL SERVICE WORKER THREAD]: Error ", e)); | ||
291 | } | ||
292 | } | ||
293 | } | ||
294 | } | 259 | } |
295 | } | 260 | } |
296 | 261 | ||