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 ae18bc1..cecef0d 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 | ||
@@ -222,11 +221,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
222 | new List<Hashtable>(); | 221 | new List<Hashtable>(); |
223 | private Dictionary<UUID, aPollResponse> responses = | 222 | private Dictionary<UUID, aPollResponse> responses = |
224 | new Dictionary<UUID, aPollResponse>(); | 223 | new Dictionary<UUID, aPollResponse>(); |
224 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
225 | 225 | ||
226 | private Scene m_scene; | 226 | private Scene m_scene; |
227 | private MeshCapsDataThrottler m_throttler; | 227 | private MeshCapsDataThrottler m_throttler; |
228 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : | 228 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : |
229 | base(null, uri, null, null, null, pId, int.MaxValue) | 229 | base(null, uri, null, null, null, null, pId, int.MaxValue) |
230 | { | 230 | { |
231 | m_scene = scene; | 231 | m_scene = scene; |
232 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); | 232 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); |
@@ -241,6 +241,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
241 | 241 | ||
242 | } | 242 | } |
243 | }; | 243 | }; |
244 | |||
245 | Drop = (x, y) => | ||
246 | { | ||
247 | lock (responses) | ||
248 | { | ||
249 | responses.Remove(x); | ||
250 | lock(dropedResponses) | ||
251 | dropedResponses.Add(x); | ||
252 | } | ||
253 | }; | ||
254 | |||
244 | GetEvents = (x, y) => | 255 | GetEvents = (x, y) => |
245 | { | 256 | { |
246 | lock (responses) | 257 | lock (responses) |
@@ -298,30 +309,48 @@ namespace OpenSim.Region.ClientStack.Linden | |||
298 | if(m_scene.ShuttingDown) | 309 | if(m_scene.ShuttingDown) |
299 | return; | 310 | return; |
300 | 311 | ||
301 | // If the avatar is gone, don't bother to get the texture | 312 | lock(responses) |
302 | if (m_scene.GetScenePresence(Id) == null) | ||
303 | { | 313 | { |
304 | response = new Hashtable(); | 314 | lock(dropedResponses) |
305 | 315 | { | |
306 | response["int_response_code"] = 500; | 316 | if(dropedResponses.Contains(requestID)) |
307 | response["str_response_string"] = "Script timeout"; | 317 | { |
308 | response["content_type"] = "text/plain"; | 318 | dropedResponses.Remove(requestID); |
309 | response["keepalive"] = false; | 319 | return; |
310 | response["reusecontext"] = false; | 320 | } |
321 | } | ||
322 | |||
323 | // If the avatar is gone, don't bother to get the texture | ||
324 | if (m_scene.GetScenePresence(Id) == null) | ||
325 | { | ||
326 | response = new Hashtable(); | ||
311 | 327 | ||
312 | lock (responses) | 328 | response["int_response_code"] = 500; |
313 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; | 329 | response["str_response_string"] = "Script timeout"; |
330 | response["content_type"] = "text/plain"; | ||
331 | response["keepalive"] = false; | ||
332 | responses[requestID] = new aPollResponse() { bytes = 0, response = response}; | ||
314 | 333 | ||
315 | return; | 334 | return; |
335 | } | ||
316 | } | 336 | } |
317 | 337 | ||
318 | response = m_getMeshHandler.Handle(requestinfo.request); | 338 | response = m_getMeshHandler.Handle(requestinfo.request); |
339 | |||
319 | lock (responses) | 340 | lock (responses) |
320 | { | 341 | { |
342 | lock(dropedResponses) | ||
343 | { | ||
344 | if(dropedResponses.Contains(requestID)) | ||
345 | { | ||
346 | dropedResponses.Remove(requestID); | ||
347 | return; | ||
348 | } | ||
349 | } | ||
350 | |||
321 | responses[requestID] = new aPollResponse() | 351 | responses[requestID] = new aPollResponse() |
322 | { | 352 | { |
323 | bytes = (int)response["int_bytes"], | 353 | bytes = (int)response["int_bytes"], |
324 | lod = (int)response["int_lod"], | ||
325 | response = response | 354 | response = response |
326 | }; | 355 | }; |
327 | 356 | ||
@@ -390,7 +419,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
390 | private volatile int lastTimeElapsed = 0; | 419 | private volatile int lastTimeElapsed = 0; |
391 | private volatile int BytesSent = 0; | 420 | private volatile int BytesSent = 0; |
392 | private int CapSetThrottle = 0; | 421 | private int CapSetThrottle = 0; |
393 | private float CapThrottleDistributon = 0.30f; | ||
394 | private readonly Scene m_scene; | 422 | private readonly Scene m_scene; |
395 | private ThrottleOutPacketType Throttle; | 423 | private ThrottleOutPacketType Throttle; |
396 | private readonly UUID User; | 424 | private readonly UUID User; |