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

[core] Try harder to send a valid port to the tracker #624

Merged

Conversation

alanmcgovern
Copy link
Owner

@alanmcgovern alanmcgovern commented Feb 2, 2023

The main part of this change is that the actual IPEndPoint which the listnener has been bound to is not the sole source of the 'port' value which should be sent to the tracker.

If the listener has been configured to bind to a specific port, but has (at the point in time when the announce is sent) not successfully bound to that port, the preferred port should be sent to the tracker.

If the user has configured the listener to port '0' and the listener isn't running, then we have a problem as 'port' is a required parameter and must be sent. In this scenario, send an invalid port and the tracker should still return a list of peers to connect to.

Fixes 1/2 of #613

The main part of this change is that the actual IPEndPoint
which the listnener has been bound to is not the sole source
of the 'port' value which should be sent to the tracker.

If the listener has been configured to bind to a specific
port, but has (at the point in time when the announce is
sent) not successfully bound to that port, the preferred
port should be sent to the tracker.

If the user has configured the listener to port '0' *and*
the listener isn't running, then we have a problem as 'port'
is a required parameter and must be sent. In this scenario,
send an invalid port and the tracker should still return a
list of peers to connect to.
@alanmcgovern alanmcgovern linked an issue Feb 2, 2023 that may be closed by this pull request
@alanmcgovern alanmcgovern merged commit da71b19 into master Feb 2, 2023
@alanmcgovern alanmcgovern deleted the send-preferred-port-if-no-actual-port-when-announcing branch February 2, 2023 22:37
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.

Client randomly doesn't get a sole seed from the tracker
1 participant