diff options
author | UbitUmarov | 2016-07-17 14:15:46 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-17 14:15:46 +0100 |
commit | e881562d34bcd67b4fb09c499b008db576b7e368 (patch) | |
tree | 77cc8c9fba51ecea00a6eca3e8a1da8adfc338a8 /OpenSim/Region | |
parent | add a Drop method to PollService Event handlers, Drop requests on connections... (diff) | |
download | opensim-SC-e881562d34bcd67b4fb09c499b008db576b7e368.zip opensim-SC-e881562d34bcd67b4fb09c499b008db576b7e368.tar.gz opensim-SC-e881562d34bcd67b4fb09c499b008db576b7e368.tar.bz2 opensim-SC-e881562d34bcd67b4fb09c499b008db576b7e368.tar.xz |
fix drop on delayed events processing
Diffstat (limited to 'OpenSim/Region')
3 files changed, 130 insertions, 45 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 7831de3..783c3de 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -222,6 +222,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
222 | new List<Hashtable>(); | 222 | new List<Hashtable>(); |
223 | private Dictionary<UUID, aPollResponse> responses = | 223 | private Dictionary<UUID, aPollResponse> responses = |
224 | new Dictionary<UUID, aPollResponse>(); | 224 | new Dictionary<UUID, aPollResponse>(); |
225 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
225 | 226 | ||
226 | private Scene m_scene; | 227 | private Scene m_scene; |
227 | private MeshCapsDataThrottler m_throttler; | 228 | private MeshCapsDataThrottler m_throttler; |
@@ -242,11 +243,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
242 | } | 243 | } |
243 | }; | 244 | }; |
244 | 245 | ||
245 | Drop= (x, y) => | 246 | Drop = (x, y) => |
246 | { | 247 | { |
247 | lock (responses) | 248 | lock (responses) |
248 | { | 249 | { |
249 | responses.Remove(x); | 250 | responses.Remove(x); |
251 | lock(dropedResponses) | ||
252 | dropedResponses.Add(x); | ||
250 | } | 253 | } |
251 | }; | 254 | }; |
252 | 255 | ||
@@ -307,26 +310,47 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | if(m_scene.ShuttingDown) | 310 | if(m_scene.ShuttingDown) |
308 | return; | 311 | return; |
309 | 312 | ||
310 | // If the avatar is gone, don't bother to get the texture | 313 | lock(responses) |
311 | if (m_scene.GetScenePresence(Id) == null) | ||
312 | { | 314 | { |
313 | response = new Hashtable(); | 315 | lock(dropedResponses) |
316 | { | ||
317 | if(dropedResponses.Contains(requestID)) | ||
318 | { | ||
319 | dropedResponses.Remove(requestID); | ||
320 | return; | ||
321 | } | ||
322 | } | ||
323 | |||
324 | // If the avatar is gone, don't bother to get the texture | ||
325 | if (m_scene.GetScenePresence(Id) == null) | ||
326 | { | ||
327 | response = new Hashtable(); | ||
314 | 328 | ||
315 | response["int_response_code"] = 500; | 329 | response["int_response_code"] = 500; |
316 | response["str_response_string"] = "Script timeout"; | 330 | response["str_response_string"] = "Script timeout"; |
317 | response["content_type"] = "text/plain"; | 331 | response["content_type"] = "text/plain"; |
318 | response["keepalive"] = false; | 332 | response["keepalive"] = false; |
319 | response["reusecontext"] = false; | 333 | response["reusecontext"] = false; |
320 | 334 | ||
321 | lock (responses) | ||
322 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; | 335 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; |
323 | 336 | ||
324 | return; | 337 | return; |
338 | } | ||
325 | } | 339 | } |
326 | 340 | ||
327 | response = m_getMeshHandler.Handle(requestinfo.request); | 341 | response = m_getMeshHandler.Handle(requestinfo.request); |
342 | |||
328 | lock (responses) | 343 | lock (responses) |
329 | { | 344 | { |
345 | lock(dropedResponses) | ||
346 | { | ||
347 | if(dropedResponses.Contains(requestID)) | ||
348 | { | ||
349 | dropedResponses.Remove(requestID); | ||
350 | return; | ||
351 | } | ||
352 | } | ||
353 | |||
330 | responses[requestID] = new aPollResponse() | 354 | responses[requestID] = new aPollResponse() |
331 | { | 355 | { |
332 | bytes = (int)response["int_bytes"], | 356 | bytes = (int)response["int_bytes"], |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index ee7e291..15c0967 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -218,6 +218,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
218 | new List<Hashtable>(); | 218 | new List<Hashtable>(); |
219 | private Dictionary<UUID, aPollResponse> responses = | 219 | private Dictionary<UUID, aPollResponse> responses = |
220 | new Dictionary<UUID, aPollResponse>(); | 220 | new Dictionary<UUID, aPollResponse>(); |
221 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
221 | 222 | ||
222 | private Scene m_scene; | 223 | private Scene m_scene; |
223 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000); | 224 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000); |
@@ -237,7 +238,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
237 | } | 238 | } |
238 | }; | 239 | }; |
239 | 240 | ||
240 | Drop = (x, y) => { lock (responses) responses.Remove(x); }; | 241 | Drop = (x, y) => |
242 | { | ||
243 | lock (responses) | ||
244 | { | ||
245 | responses.Remove(x); | ||
246 | dropedResponses.Add(x); | ||
247 | } | ||
248 | }; | ||
241 | 249 | ||
242 | GetEvents = (x, y) => | 250 | GetEvents = (x, y) => |
243 | { | 251 | { |
@@ -307,52 +315,71 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | if(m_scene.ShuttingDown) | 315 | if(m_scene.ShuttingDown) |
308 | return; | 316 | return; |
309 | 317 | ||
310 | if (requestinfo.send503) | 318 | lock (responses) |
311 | { | 319 | { |
312 | response = new Hashtable(); | 320 | lock(dropedResponses) |
321 | { | ||
322 | if(dropedResponses.Contains(requestID)) | ||
323 | { | ||
324 | dropedResponses.Remove(requestID); | ||
325 | return; | ||
326 | } | ||
327 | } | ||
313 | 328 | ||
314 | response["int_response_code"] = 503; | 329 | if (requestinfo.send503) |
315 | response["str_response_string"] = "Throttled"; | 330 | { |
316 | response["content_type"] = "text/plain"; | 331 | response = new Hashtable(); |
317 | response["keepalive"] = false; | ||
318 | response["reusecontext"] = false; | ||
319 | 332 | ||
320 | Hashtable headers = new Hashtable(); | 333 | response["int_response_code"] = 503; |
321 | headers["Retry-After"] = 30; | 334 | response["str_response_string"] = "Throttled"; |
322 | response["headers"] = headers; | 335 | response["content_type"] = "text/plain"; |
323 | 336 | response["keepalive"] = false; | |
324 | lock (responses) | 337 | response["reusecontext"] = false; |
338 | |||
339 | Hashtable headers = new Hashtable(); | ||
340 | headers["Retry-After"] = 30; | ||
341 | response["headers"] = headers; | ||
342 | |||
325 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 343 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
326 | 344 | ||
327 | return; | 345 | return; |
328 | } | 346 | } |
329 | 347 | ||
330 | // If the avatar is gone, don't bother to get the texture | 348 | // If the avatar is gone, don't bother to get the texture |
331 | if (m_scene.GetScenePresence(Id) == null) | 349 | if (m_scene.GetScenePresence(Id) == null) |
332 | { | 350 | { |
333 | response = new Hashtable(); | 351 | response = new Hashtable(); |
334 | 352 | ||
335 | response["int_response_code"] = 500; | 353 | response["int_response_code"] = 500; |
336 | response["str_response_string"] = "Script timeout"; | 354 | response["str_response_string"] = "Script timeout"; |
337 | response["content_type"] = "text/plain"; | 355 | response["content_type"] = "text/plain"; |
338 | response["keepalive"] = false; | 356 | response["keepalive"] = false; |
339 | response["reusecontext"] = false; | 357 | response["reusecontext"] = false; |
340 | 358 | ||
341 | lock (responses) | ||
342 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 359 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
343 | 360 | ||
344 | return; | 361 | return; |
362 | } | ||
345 | } | 363 | } |
346 | 364 | ||
347 | response = m_getTextureHandler.Handle(requestinfo.request); | 365 | response = m_getTextureHandler.Handle(requestinfo.request); |
366 | |||
348 | lock (responses) | 367 | lock (responses) |
349 | { | 368 | { |
369 | lock(dropedResponses) | ||
370 | { | ||
371 | if(dropedResponses.Contains(requestID)) | ||
372 | { | ||
373 | dropedResponses.Remove(requestID); | ||
374 | m_throttler.ProcessTime(); | ||
375 | return; | ||
376 | } | ||
377 | } | ||
350 | responses[requestID] = new aPollResponse() | 378 | responses[requestID] = new aPollResponse() |
351 | { | 379 | { |
352 | bytes = (int) response["int_bytes"], | 380 | bytes = (int) response["int_bytes"], |
353 | response = response | 381 | response = response |
354 | }; | 382 | }; |
355 | |||
356 | } | 383 | } |
357 | m_throttler.ProcessTime(); | 384 | m_throttler.ProcessTime(); |
358 | } | 385 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index bde94e6..ed5b3dd 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -250,8 +250,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | { | 250 | { |
251 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 251 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
252 | 252 | ||
253 | private Dictionary<UUID, Hashtable> responses = | 253 | private Dictionary<UUID, Hashtable> responses = new Dictionary<UUID, Hashtable>(); |
254 | new Dictionary<UUID, Hashtable>(); | 254 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); |
255 | 255 | ||
256 | private WebFetchInvDescModule m_module; | 256 | private WebFetchInvDescModule m_module; |
257 | 257 | ||
@@ -261,7 +261,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
261 | m_module = module; | 261 | m_module = module; |
262 | 262 | ||
263 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; | 263 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; |
264 | Drop = (x, y) => { lock (responses) responses.Remove(x); }; | 264 | |
265 | Drop = (x, y) => | ||
266 | { | ||
267 | lock (responses) | ||
268 | { | ||
269 | responses.Remove(x); | ||
270 | lock(dropedResponses) | ||
271 | dropedResponses.Add(x); | ||
272 | } | ||
273 | }; | ||
265 | 274 | ||
266 | GetEvents = (x, y) => | 275 | GetEvents = (x, y) => |
267 | { | 276 | { |
@@ -367,6 +376,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
367 | 376 | ||
368 | UUID requestID = requestinfo.reqID; | 377 | UUID requestID = requestinfo.reqID; |
369 | 378 | ||
379 | |||
380 | lock(responses) | ||
381 | { | ||
382 | lock(dropedResponses) | ||
383 | { | ||
384 | if(dropedResponses.Contains(requestID)) | ||
385 | { | ||
386 | dropedResponses.Remove(requestID); | ||
387 | return; | ||
388 | } | ||
389 | } | ||
390 | } | ||
391 | |||
370 | Hashtable response = new Hashtable(); | 392 | Hashtable response = new Hashtable(); |
371 | 393 | ||
372 | response["int_response_code"] = 200; | 394 | response["int_response_code"] = 200; |
@@ -379,6 +401,18 @@ namespace OpenSim.Region.ClientStack.Linden | |||
379 | 401 | ||
380 | lock (responses) | 402 | lock (responses) |
381 | { | 403 | { |
404 | lock(dropedResponses) | ||
405 | { | ||
406 | if(dropedResponses.Contains(requestID)) | ||
407 | { | ||
408 | dropedResponses.Remove(requestID); | ||
409 | requestinfo.folders.Clear(); | ||
410 | requestinfo.request.Clear(); | ||
411 | WebFetchInvDescModule.ProcessedRequestsCount++; | ||
412 | return; | ||
413 | } | ||
414 | } | ||
415 | |||
382 | if (responses.ContainsKey(requestID)) | 416 | if (responses.ContainsKey(requestID)) |
383 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); | 417 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); |
384 | responses[requestID] = response; | 418 | responses[requestID] = response; |