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.
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
ar_data_sync: Skip unpacking if the chunk was downloaded from the local peer #637
base: master
Are you sure you want to change the base?
ar_data_sync: Skip unpacking if the chunk was downloaded from the local peer #637
Changes from 5 commits
3fe8b47
9b8a178
9d4f815
2550673
b4781c4
2b7ad31
2a1e4e0
3c05276
db96e93
46f63d0
bca0739
84ba1ea
5de91fd
1bc997f
5f5d75c
0ebfa93
8fd0010
d2d363c
a39fde2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
local_peers should be all in the same format so I think we can just use lists:member
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.
Actually not, that's the problem here.
Cowboy uses standard Erlang address tuple:
{{O1, O2, O3, O4}, Port}
, while local peers are parsed into five-tuple:{O1, O2, O3, O4, Port}
.Probably should change this, but I'm afraid I can suddenly break something. Should I try?
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.
@shizzard unfortunately it looks
ar_util:safe_parse_peer
andar_util:parse_peer
are used to parse all config peers and they always dump to the 5 element tuple. I agree probably too risky to update that now, but can you log a github issue? Seems like something we should rationalize with cowboy.FWIW it looks like the parse_peer code is from 7 years ago (!)
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.
We don't really have a good place for peer-related utilities. But there are a few in
ar_util
. I thinkis_matching_addr
and maybe even thelocal_peers
fold could live there with the other peer utilities (e.g. maybear_util:peer_addr_is_member
or something)