aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs89
1 files changed, 58 insertions, 31 deletions
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 }