diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 24 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 14 |
2 files changed, 32 insertions, 6 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index e636c38..5bd63a6 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | |||
@@ -114,7 +114,29 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
114 | PollServiceArgs.RequestsHandled++; | 114 | PollServiceArgs.RequestsHandled++; |
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | internal void DoHTTPstop(BaseHttpServer server) | ||
119 | { | ||
120 | OSHttpResponse response | ||
121 | = new OSHttpResponse(new HttpResponse(HttpContext, Request), HttpContext); | ||
122 | |||
123 | response.SendChunked = false; | ||
124 | response.ContentLength64 = 0; | ||
125 | response.ContentEncoding = Encoding.UTF8; | ||
126 | response.ReuseContext = false; | ||
127 | response.KeepAlive = false; | ||
128 | response.SendChunked = false; | ||
129 | response.StatusCode = 503; | ||
130 | |||
131 | try | ||
132 | { | ||
133 | response.OutputStream.Flush(); | ||
134 | response.Send(); | ||
135 | } | ||
136 | catch (Exception e) | ||
137 | { | ||
138 | } | ||
139 | } | ||
118 | } | 140 | } |
119 | 141 | ||
120 | class PollServiceHttpRequestComparer : IEqualityComparer<PollServiceHttpRequest> | 142 | class PollServiceHttpRequestComparer : IEqualityComparer<PollServiceHttpRequest> |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 2c5c41d..b56ade8 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -204,12 +204,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
204 | foreach (Thread t in m_workerThreads) | 204 | foreach (Thread t in m_workerThreads) |
205 | Watchdog.AbortThread(t.ManagedThreadId); | 205 | Watchdog.AbortThread(t.ManagedThreadId); |
206 | 206 | ||
207 | // any entry in m_bycontext should have a active request on the other queues | ||
208 | // so just delete contents to easy GC | ||
209 | foreach (Queue<PollServiceHttpRequest> qu in m_bycontext.Values) | ||
210 | qu.Clear(); | ||
211 | m_bycontext.Clear(); | ||
212 | |||
207 | try | 213 | try |
208 | { | 214 | { |
209 | foreach (PollServiceHttpRequest req in m_retryRequests) | 215 | foreach (PollServiceHttpRequest req in m_retryRequests) |
210 | { | 216 | { |
211 | req.DoHTTPGruntWork(m_server, | 217 | req.DoHTTPstop(m_server); |
212 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | ||
213 | } | 218 | } |
214 | } | 219 | } |
215 | catch | 220 | catch |
@@ -221,7 +226,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
221 | 226 | ||
222 | lock (m_slowRequests) | 227 | lock (m_slowRequests) |
223 | { | 228 | { |
224 | while (m_slowRequests.Count > 0 && m_running) | 229 | while (m_slowRequests.Count > 0) |
225 | m_requests.Enqueue(m_slowRequests.Dequeue()); | 230 | m_requests.Enqueue(m_slowRequests.Dequeue()); |
226 | } | 231 | } |
227 | 232 | ||
@@ -230,8 +235,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
230 | try | 235 | try |
231 | { | 236 | { |
232 | wreq = m_requests.Dequeue(0); | 237 | wreq = m_requests.Dequeue(0); |
233 | wreq.DoHTTPGruntWork(m_server, | 238 | wreq.DoHTTPstop(m_server); |
234 | wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); | ||
235 | } | 239 | } |
236 | catch | 240 | catch |
237 | { | 241 | { |