diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmessage/llcircuit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llcircuit.cpp b/linden/indra/llmessage/llcircuit.cpp index 12a1520..7b2f241 100644 --- a/linden/indra/llmessage/llcircuit.cpp +++ b/linden/indra/llmessage/llcircuit.cpp | |||
@@ -60,6 +60,7 @@ | |||
60 | #include "llrand.h" | 60 | #include "llrand.h" |
61 | #include "llstl.h" | 61 | #include "llstl.h" |
62 | #include "lltransfermanager.h" | 62 | #include "lltransfermanager.h" |
63 | #include "llmodularmath.h" | ||
63 | 64 | ||
64 | const F32 PING_INTERVAL = 5.f; // seconds | 65 | const F32 PING_INTERVAL = 5.f; // seconds |
65 | const S32 PING_START_BLOCK = 3; // How many pings behind we have to be to consider ourself blocked. | 66 | const S32 PING_START_BLOCK = 3; // How many pings behind we have to be to consider ourself blocked. |
@@ -676,6 +677,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) | |||
676 | mPacketsIn++; | 677 | mPacketsIn++; |
677 | setPacketInID((id + 1) % LL_MAX_OUT_PACKET_ID); | 678 | setPacketInID((id + 1) % LL_MAX_OUT_PACKET_ID); |
678 | 679 | ||
680 | mLastPacketGap = 0; | ||
681 | mOutOfOrderRate.count(0); | ||
679 | return; | 682 | return; |
680 | } | 683 | } |
681 | 684 | ||
@@ -683,6 +686,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) | |||
683 | 686 | ||
684 | 687 | ||
685 | // now, check to see if we've got a gap | 688 | // now, check to see if we've got a gap |
689 | U32 gap = 0; | ||
686 | if ((mPacketsInID == id)) | 690 | if ((mPacketsInID == id)) |
687 | { | 691 | { |
688 | // nope! bump and wrap the counter, then return | 692 | // nope! bump and wrap the counter, then return |
@@ -704,6 +708,11 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) | |||
704 | // otherwise, walk from mCurrentCircuit->mPacketsInID to id with wrapping, adding the values to the map | 708 | // otherwise, walk from mCurrentCircuit->mPacketsInID to id with wrapping, adding the values to the map |
705 | // and setting mPacketsInID to id + 1 % LL_MAX_OUT_PACKET_ID | 709 | // and setting mPacketsInID to id + 1 % LL_MAX_OUT_PACKET_ID |
706 | 710 | ||
711 | // babbage: all operands in expression are unsigned, so modular | ||
712 | // arithmetic will always find correct gap, regardless of wrap arounds. | ||
713 | const U8 width = 24; | ||
714 | gap = LLModularMath::subtract<width>(mPacketsInID, id); | ||
715 | |||
707 | if (mPotentialLostPackets.find(id) != mPotentialLostPackets.end()) | 716 | if (mPotentialLostPackets.find(id) != mPotentialLostPackets.end()) |
708 | { | 717 | { |
709 | if(gMessageSystem->mVerboseLog) | 718 | if(gMessageSystem->mVerboseLog) |
@@ -765,6 +774,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) | |||
765 | 774 | ||
766 | } | 775 | } |
767 | } | 776 | } |
777 | mOutOfOrderRate.count(gap); | ||
778 | mLastPacketGap = gap; | ||
768 | } | 779 | } |
769 | 780 | ||
770 | 781 | ||