aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-17 17:33:57 +0000
committerJustin Clarke Casey2008-12-17 17:33:57 +0000
commitab77b22f0f2efce0913af3195faef96d593e89be (patch)
tree991dba20baf44c80963e314c69d55f97cfe6eb2d /OpenSim/Region
parentRevamp packet handler to smooth out the stream of resent packets. (diff)
downloadopensim-SC_OLD-ab77b22f0f2efce0913af3195faef96d593e89be.zip
opensim-SC_OLD-ab77b22f0f2efce0913af3195faef96d593e89be.tar.gz
opensim-SC_OLD-ab77b22f0f2efce0913af3195faef96d593e89be.tar.bz2
opensim-SC_OLD-ab77b22f0f2efce0913af3195faef96d593e89be.tar.xz
* Only serialize packets once for the length calculation for throttle queues rather than twice
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs41
1 files changed, 25 insertions, 16 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 3ce71dc..2d02dfc 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -344,9 +344,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
344 { 344 {
345 LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); 345 LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue();
346 346
347 SendQueue.Enqueue(qpack); 347 SendQueue.Enqueue(qpack);
348 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 348 int qpackSize = qpack.Packet.ToBytes().Length;
349 ResendThrottle.AddBytes(qpack.Packet.ToBytes().Length); 349 TotalThrottle.AddBytes(qpackSize);
350 ResendThrottle.AddBytes(qpackSize);
351
350 qchanged = true; 352 qchanged = true;
351 } 353 }
352 354
@@ -355,8 +357,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
355 LLQueItem qpack = LandOutgoingPacketQueue.Dequeue(); 357 LLQueItem qpack = LandOutgoingPacketQueue.Dequeue();
356 358
357 SendQueue.Enqueue(qpack); 359 SendQueue.Enqueue(qpack);
358 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 360 int qpackSize = qpack.Packet.ToBytes().Length;
359 LandThrottle.AddBytes(qpack.Packet.ToBytes().Length); 361 TotalThrottle.AddBytes(qpackSize);
362 LandThrottle.AddBytes(qpackSize);
360 qchanged = true; 363 qchanged = true;
361 } 364 }
362 365
@@ -365,8 +368,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
365 LLQueItem qpack = WindOutgoingPacketQueue.Dequeue(); 368 LLQueItem qpack = WindOutgoingPacketQueue.Dequeue();
366 369
367 SendQueue.Enqueue(qpack); 370 SendQueue.Enqueue(qpack);
368 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 371 int qpackSize = qpack.Packet.ToBytes().Length;
369 WindThrottle.AddBytes(qpack.Packet.ToBytes().Length); 372 TotalThrottle.AddBytes(qpackSize);
373 WindThrottle.AddBytes(qpackSize);
370 qchanged = true; 374 qchanged = true;
371 } 375 }
372 376
@@ -375,8 +379,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
375 LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue(); 379 LLQueItem qpack = CloudOutgoingPacketQueue.Dequeue();
376 380
377 SendQueue.Enqueue(qpack); 381 SendQueue.Enqueue(qpack);
378 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 382 int qpackSize = qpack.Packet.ToBytes().Length;
379 CloudThrottle.AddBytes(qpack.Packet.ToBytes().Length); 383 TotalThrottle.AddBytes(qpackSize);
384 CloudThrottle.AddBytes(qpackSize);
380 qchanged = true; 385 qchanged = true;
381 } 386 }
382 387
@@ -393,8 +398,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
393 qpack = TaskLowpriorityPacketQueue.Dequeue(); 398 qpack = TaskLowpriorityPacketQueue.Dequeue();
394 SendQueue.Enqueue(qpack); 399 SendQueue.Enqueue(qpack);
395 } 400 }
396 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 401
397 TaskThrottle.AddBytes(qpack.Packet.ToBytes().Length); 402 int qpackSize = qpack.Packet.ToBytes().Length;
403 TotalThrottle.AddBytes(qpackSize);
404 TaskThrottle.AddBytes(qpackSize);
398 qchanged = true; 405 qchanged = true;
399 } 406 }
400 407
@@ -402,9 +409,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
402 { 409 {
403 LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); 410 LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue();
404 411
405 SendQueue.Enqueue(qpack); 412 SendQueue.Enqueue(qpack);
406 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 413 int qpackSize = qpack.Packet.ToBytes().Length;
407 TextureThrottle.AddBytes(qpack.Packet.ToBytes().Length); 414 TotalThrottle.AddBytes(qpackSize);
415 TextureThrottle.AddBytes(qpackSize);
408 qchanged = true; 416 qchanged = true;
409 } 417 }
410 418
@@ -413,8 +421,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
413 LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue(); 421 LLQueItem qpack = AssetOutgoingPacketQueue.Dequeue();
414 422
415 SendQueue.Enqueue(qpack); 423 SendQueue.Enqueue(qpack);
416 TotalThrottle.AddBytes(qpack.Packet.ToBytes().Length); 424 int qpackSize = qpack.Packet.ToBytes().Length;
417 AssetThrottle.AddBytes(qpack.Packet.ToBytes().Length); 425 TotalThrottle.AddBytes(qpackSize);
426 AssetThrottle.AddBytes(qpackSize);
418 qchanged = true; 427 qchanged = true;
419 } 428 }
420 } 429 }