Skip to content

Allow UDP clients to limit peers in response#1035

Merged
josecelano merged 2 commits intotorrust:developfrom
josecelano:569-the-tracker-is-ignoring-the-num_want-param-in-the-announce-request
Sep 11, 2024
Merged

Allow UDP clients to limit peers in response#1035
josecelano merged 2 commits intotorrust:developfrom
josecelano:569-the-tracker-is-ignoring-the-num_want-param-in-the-announce-request

Conversation

@josecelano
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
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