-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ordering arranging handler for >65536 packets #229
Conversation
The expected index is a u16 at the protocol level, but the arranging implementation for orderingstream does not take this into account. This caused sending over 2**16 ordered packets to simply default to the `None` case and get ignored. This patch solves that issue.
Codecov Report
@@ Coverage Diff @@
## master #229 +/- ##
==========================================
+ Coverage 97.37% 97.54% +0.16%
==========================================
Files 25 25
Lines 2440 2486 +46
==========================================
+ Hits 2376 2425 +49
+ Misses 64 61 -3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the 1 comment, looks good.
dd150cb
to
ce03a18
Compare
Previously we would only store packets with indices higher than the expected index, this is obviously not going to give us good results when we receive packets 0..100 while we are currently expecting index 65500. What this patch does is that it stores all incoming packets with the condition: expected < index < expected + u16::max/2 With wrapping add this becomes slightly more complex but the gist is the same.
Fix ordering arranging handler for >65536 packets
Fix ordering arranging handler for >65536 packets
The arranging handler would not reset the value of the expecting index back to 0 which caused the case of having over 2**16 packets to simply be ignored.
Note: This is #227 but for some reason it didn't track my commits after merging #228, so that one got closed and this one opened. (Apparently had upstreamed to master...)