This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Flip iter operations to keep associated address/header/packets together#22245
Merged
steviez merged 2 commits intosolana-labs:masterfrom Jan 3, 2022
Merged
Flip iter operations to keep associated address/header/packets together#22245steviez merged 2 commits intosolana-labs:masterfrom
steviez merged 2 commits intosolana-labs:masterfrom
Conversation
Before this change, if cast_socket_addr() returned a None for any address/header pair, the subsequent zip() would misalign the address/header pair and packet. So, this change zips all three together, then does filter_map() so keep things aligned. Additionally, compute total_size inline to avoid running through packets a second time.
behzadnouri
previously approved these changes
Jan 3, 2022
Contributor
behzadnouri
left a comment
There was a problem hiding this comment.
thanks for spotting this.
Pull request has been modified.
Codecov Report
@@ Coverage Diff @@
## master #22245 +/- ##
=========================================
- Coverage 81.0% 81.0% -0.1%
=========================================
Files 523 523
Lines 146529 146528 -1
=========================================
- Hits 118769 118767 -2
- Misses 27760 27761 +1 |
mergify Bot
pushed a commit
that referenced
this pull request
Jan 3, 2022
…er (#22245) Flip iter operations to keep associated address/header/packets together Before this change, if cast_socket_addr() returned a None for any address/header pair, the subsequent zip() would misalign the address/header pair and packet. So, this change zips all three together, then does filter_map() so keep things aligned. Additionally, compute total_size inline to avoid running through packets a second time. (cherry picked from commit 20b61e2) # Conflicts: # streamer/src/recvmmsg.rs
mergify Bot
pushed a commit
that referenced
this pull request
Jan 3, 2022
…er (#22245) Flip iter operations to keep associated address/header/packets together Before this change, if cast_socket_addr() returned a None for any address/header pair, the subsequent zip() would misalign the address/header pair and packet. So, this change zips all three together, then does filter_map() so keep things aligned. Additionally, compute total_size inline to avoid running through packets a second time. (cherry picked from commit 20b61e2)
mergify Bot
added a commit
that referenced
this pull request
Jan 4, 2022
…er (#22245) (#22257) Flip iter operations to keep associated address/header/packets together Before this change, if cast_socket_addr() returned a None for any address/header pair, the subsequent zip() would misalign the address/header pair and packet. So, this change zips all three together, then does filter_map() so keep things aligned. Additionally, compute total_size inline to avoid running through packets a second time. (cherry picked from commit 20b61e2) Co-authored-by: steviez <steven@solana.com>
mergify Bot
added a commit
that referenced
this pull request
Jan 4, 2022
…er (backport #22245) (#22256) * Flip iter operations to keep associated address/header/packets together (#22245) Flip iter operations to keep associated address/header/packets together Before this change, if cast_socket_addr() returned a None for any address/header pair, the subsequent zip() would misalign the address/header pair and packet. So, this change zips all three together, then does filter_map() so keep things aligned. Additionally, compute total_size inline to avoid running through packets a second time. (cherry picked from commit 20b61e2) # Conflicts: # streamer/src/recvmmsg.rs * removes backport merge conflicts Co-authored-by: steviez <steven@solana.com> Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet.
Summary of Changes
So, this change zips all three together,
then does filter_map() so keep things aligned.
Additionally, compute
total_sizeinline to avoid running through packetsa second time.