Commit 692c40f
committed
SNP: fix stop-waiting clamp and improve sentinel guard in gap-trim loop
Fixed a latent bug where nPktNumBeforeSentinelGap was declared int instead
of int64. On connections that have exchanged more than ~2.1 billion
packets, the sentinel key truncates to a large negative value, the clamp
misfires unconditionally, and m_nMinPktNumToSendAcks gets set to that
negative value -- permanently breaking stop-waiting advancement for that
connection.
Also rewrote the paranoia guard that protects the gap-trim loop from walking
into the sentinel. The old check was buried inside the m_nEnd > nMinPktNumToSendAcks
branch (which the sentinel always entered) and contained a dead
Assert( h == end() ) that could never be true. The new check uses an explicit
itSentinel iterator captured before the loop, tests for it first before
consulting m_nEnd, and adds a belt-and-suspenders m_nEnd == INT64_MAX condition.
Changed AssertMsg to AssertMsgOnce since this is a paranoia path that should
never fire in practice.1 parent 57e6d08 commit 692c40f
1 file changed
Lines changed: 13 additions & 12 deletions
Lines changed: 13 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
| 1017 | + | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| |||
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| 1050 | + | |
1050 | 1051 | | |
1051 | 1052 | | |
1052 | 1053 | | |
1053 | | - | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
1054 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1055 | 1062 | | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
| 1063 | + | |
| 1064 | + | |
1064 | 1065 | | |
1065 | 1066 | | |
1066 | 1067 | | |
| |||
3759 | 3760 | | |
3760 | 3761 | | |
3761 | 3762 | | |
3762 | | - | |
| 3763 | + | |
3763 | 3764 | | |
3764 | 3765 | | |
3765 | 3766 | | |
| |||
3803 | 3804 | | |
3804 | 3805 | | |
3805 | 3806 | | |
3806 | | - | |
| 3807 | + | |
3807 | 3808 | | |
3808 | 3809 | | |
3809 | 3810 | | |
| |||
0 commit comments