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

Allow UDP clients to limit peers in response #1035

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Sep 10, 2024

The UDP tracker announce response always include all peers available up to a maxium of 74 peers, ignoring the num_want param in the request described in:

https://www.bittorrent.org/beps/bep_0015.html

This change applies that limit only when is lower than then TORRENT_PEERS_LIMIT (74).

It also adds the numwant GET param to the announce request for the HTTP tracker for the same purpose.

  • UDP tracker (num_want, positional param in the UDP packet).
  • HTTP tracker (numwant GET param).

@josecelano josecelano linked an issue Sep 10, 2024 that may be closed by this pull request
@josecelano josecelano self-assigned this Sep 10, 2024
@josecelano josecelano added Enhancement / Feature Request Something New - User - Enjoyable to Use our Software labels Sep 10, 2024
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 91.42857% with 12 lines in your changes missing coverage. Please review.

Project coverage is 77.24%. Comparing base (1e437f7) to head (084879e).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/core/mod.rs 88.17% 11 Missing ⚠️
src/servers/http/v1/handlers/announce.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1035      +/-   ##
===========================================
+ Coverage    77.05%   77.24%   +0.18%     
===========================================
  Files          178      178              
  Lines        10068    10181     +113     
===========================================
+ Hits          7758     7864     +106     
- Misses        2310     2317       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The UDP tracker announce response always include all peers available up to a
maxium of 74 peers, ignoring the `num_want` param in the request
described in:

https://www.bittorrent.org/beps/bep_0015.html

This change applies that limit only when is lower than then
TORRENT_PEERS_LIMIT (74).
@josecelano josecelano force-pushed the 569-the-tracker-is-ignoring-the-num_want-param-in-the-announce-request branch from 21f6b2e to 481d413 Compare September 10, 2024 16:25
It allows HTTP clients to limit peers in the announce response with the
`numwant` GET param.
@josecelano josecelano marked this pull request as ready for review September 10, 2024 17:50
@josecelano
Copy link
Member Author

ACK 084879e

@josecelano josecelano requested a review from da2ce7 September 10, 2024 17:53
@josecelano josecelano merged commit c71d88c into torrust:develop Sep 11, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- User - Enjoyable to Use our Software Enhancement / Feature Request Something New
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The tracker is ignoring the num_want param in the announce request.
1 participant