Skip to content
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

Disambiguate between v1 and v2 connections more clearly #675

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

alanmcgovern
Copy link
Owner

As per BEP52 - if a connection is initiated with the V1 infohash and the relevant reserved bit is set, respond with the V2 infohash to upgrade the connection to 'V2' mode. This makes it unambiguous as to whether or not a given peer supports BEP52.

More importantly, the 'ExpectedInfoHash' property is now the clear indicator as to whether a given peer supports BEP52 or not, as it will always be set to the V2 infohash if the peer supports V2 torrents.

This means peers supporting v1 only can be filtered out when requesting piecelayers from other V2 peers.

As per BEP52 - if a connection is initiated with the V1 infohash and the relevant reserved bit is set, respond with the V2 infohash to upgrade the connection to 'V2' mode. This makes it unambiguous as to whether or not a given peer supports BEP52.

More importantly, the 'ExpectedInfoHash' property is now the clear indicator as to whether a given peer supports BEP52 or not, as it will always be set to the V2 infohash if the peer supports V2 torrents.

This means peers supporting v1 only can be filtered out when requesting piecelayers from other V2 peers.
@alanmcgovern alanmcgovern force-pushed the support-upgradeable-bep52-connections branch from edb7bf5 to 5e9b8fa Compare August 10, 2024 22:28
@alanmcgovern alanmcgovern merged commit 9a6db98 into master Aug 10, 2024
0 of 2 checks passed
@alanmcgovern alanmcgovern deleted the support-upgradeable-bep52-connections branch August 10, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant