diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index a721454..414b9bf 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -76,7 +76,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
76 | { | 76 | { |
77 | public Hashtable response; | 77 | public Hashtable response; |
78 | public int bytes; | 78 | public int bytes; |
79 | public int lod; | ||
80 | } | 79 | } |
81 | 80 | ||
82 | 81 | ||
@@ -231,11 +230,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
231 | new List<Hashtable>(); | 230 | new List<Hashtable>(); |
232 | private Dictionary<UUID, aPollResponse> responses = | 231 | private Dictionary<UUID, aPollResponse> responses = |
233 | new Dictionary<UUID, aPollResponse>(); | 232 | new Dictionary<UUID, aPollResponse>(); |
233 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
234 | 234 | ||
235 | private Scene m_scene; | 235 | private Scene m_scene; |
236 | private MeshCapsDataThrottler m_throttler; | 236 | private MeshCapsDataThrottler m_throttler; |
237 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : | 237 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : |
238 | base(null, uri, null, null, null, pId, int.MaxValue) | 238 | base(null, uri, null, null, null, null, pId, int.MaxValue) |
239 | { | 239 | { |
240 | m_scene = scene; | 240 | m_scene = scene; |
241 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); | 241 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); |
@@ -250,6 +250,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | 250 | ||
251 | } | 251 | } |
252 | }; | 252 | }; |
253 | |||
254 | Drop = (x, y) => | ||
255 | { | ||
256 | lock (responses) | ||
257 | { | ||
258 | responses.Remove(x); | ||
259 | lock(dropedResponses) | ||
260 | dropedResponses.Add(x); | ||
261 | } | ||
262 | }; | ||
263 | |||
253 | GetEvents = (x, y) => | 264 | GetEvents = (x, y) => |
254 | { | 265 | { |
255 | lock (responses) | 266 | lock (responses) |
@@ -307,30 +318,48 @@ namespace OpenSim.Region.ClientStack.Linden | |||
307 | if(m_scene.ShuttingDown) | 318 | if(m_scene.ShuttingDown) |
308 | return; | 319 | return; |
309 | 320 | ||
310 | // If the avatar is gone, don't bother to get the texture | 321 | lock(responses) |
311 | if (m_scene.GetScenePresence(Id) == null) | ||
312 | { | 322 | { |
313 | response = new Hashtable(); | 323 | lock(dropedResponses) |
314 | 324 | { | |
315 | response["int_response_code"] = 500; | 325 | if(dropedResponses.Contains(requestID)) |
316 | response["str_response_string"] = "Script timeout"; | 326 | { |
317 | response["content_type"] = "text/plain"; | 327 | dropedResponses.Remove(requestID); |
318 | response["keepalive"] = false; | 328 | return; |
319 | response["reusecontext"] = false; | 329 | } |
330 | } | ||
331 | |||
332 | // If the avatar is gone, don't bother to get the texture | ||
333 | if (m_scene.GetScenePresence(Id) == null) | ||
334 | { | ||
335 | response = new Hashtable(); | ||
320 | 336 | ||
321 | lock (responses) | 337 | response["int_response_code"] = 500; |
322 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; | 338 | response["str_response_string"] = "Script timeout"; |
339 | response["content_type"] = "text/plain"; | ||
340 | response["keepalive"] = false; | ||
341 | responses[requestID] = new aPollResponse() { bytes = 0, response = response}; | ||
323 | 342 | ||
324 | return; | 343 | return; |
344 | } | ||
325 | } | 345 | } |
326 | 346 | ||
327 | response = m_getMeshHandler.Handle(requestinfo.request); | 347 | response = m_getMeshHandler.Handle(requestinfo.request); |
348 | |||
328 | lock (responses) | 349 | lock (responses) |
329 | { | 350 | { |
351 | lock(dropedResponses) | ||
352 | { | ||
353 | if(dropedResponses.Contains(requestID)) | ||
354 | { | ||
355 | dropedResponses.Remove(requestID); | ||
356 | return; | ||
357 | } | ||
358 | } | ||
359 | |||
330 | responses[requestID] = new aPollResponse() | 360 | responses[requestID] = new aPollResponse() |
331 | { | 361 | { |
332 | bytes = (int)response["int_bytes"], | 362 | bytes = (int)response["int_bytes"], |
333 | lod = (int)response["int_lod"], | ||
334 | response = response | 363 | response = response |
335 | }; | 364 | }; |
336 | 365 | ||
@@ -399,7 +428,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
399 | private volatile int lastTimeElapsed = 0; | 428 | private volatile int lastTimeElapsed = 0; |
400 | private volatile int BytesSent = 0; | 429 | private volatile int BytesSent = 0; |
401 | private int CapSetThrottle = 0; | 430 | private int CapSetThrottle = 0; |
402 | private float CapThrottleDistributon = 0.30f; | ||
403 | private readonly Scene m_scene; | 431 | private readonly Scene m_scene; |
404 | private ThrottleOutPacketType Throttle; | 432 | private ThrottleOutPacketType Throttle; |
405 | private readonly UUID User; | 433 | private readonly UUID User; |