diff options
author | UbitUmarov | 2015-08-18 23:59:55 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-18 23:59:55 +0100 |
commit | 48ef22f62e07c0b9e6d23ee758a4800d05cfb231 (patch) | |
tree | d4f2b9d4b38b3e80ff459676c7a88bcf721ccfac /OpenSim | |
parent | do keepalive on mesh and texture GET. Dont use reusecontext any where. (diff) | |
download | opensim-SC_OLD-48ef22f62e07c0b9e6d23ee758a4800d05cfb231.zip opensim-SC_OLD-48ef22f62e07c0b9e6d23ee758a4800d05cfb231.tar.gz opensim-SC_OLD-48ef22f62e07c0b9e6d23ee758a4800d05cfb231.tar.bz2 opensim-SC_OLD-48ef22f62e07c0b9e6d23ee758a4800d05cfb231.tar.xz |
change pollService stop() to send 503 error and no keepalive. ( untested )
Diffstat (limited to 'OpenSim')
-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 | { |