Skip to content

Commit

Permalink
fix: off by one error in max peers per torrent per user config
Browse files Browse the repository at this point in the history
  • Loading branch information
Roardom committed Jan 13, 2025
1 parent 7338770 commit 0c67947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ pub async fn announce(
if peer.user_id == user_id && peer.is_active {
peer_count += 1;

if peer_count >= config.max_peers_per_torrent_per_user {
if peer_count > config.max_peers_per_torrent_per_user {
torrent.peers.swap_remove(&tracker::peer::Index {
user_id,
peer_id: queries.peer_id,
Expand Down

0 comments on commit 0c67947

Please sign in to comment.