diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-09 02:50:45 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-09 02:50:45 +0200 |
commit | ffa7b816905cb99e0395b6b02412ea09946f9105 (patch) | |
tree | 2264975c51f828a291cc4d05177a645ff8824c17 | |
parent | 18a746b89dadf4c5f8ed8b4feec71bcc4d4f3980 (diff) |
Only query torrents if we actually found one
-rw-r--r-- | trackerlogic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 075c0d9..6fd2724 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -444,7 +444,7 @@ size_t remove_peer_from_torrent( PROTO_FLAG proto, struct ot_workstruct *ws ) { | |||
444 | ot_peerlist *peer_list = &dummy_list; | 444 | ot_peerlist *peer_list = &dummy_list; |
445 | size_t peer_size; /* initialized in next line */ | 445 | size_t peer_size; /* initialized in next line */ |
446 | ot_peer const *peer_src = peer_from_peer6(&ws->peer, &peer_size); | 446 | ot_peer const *peer_src = peer_from_peer6(&ws->peer, &peer_size); |
447 | size_t peer_count, seed_count; | 447 | size_t peer_count = 0, seed_count = 0; |
448 | 448 | ||
449 | #ifdef WANT_SYNC_LIVE | 449 | #ifdef WANT_SYNC_LIVE |
450 | if( proto != FLAG_MCA ) { | 450 | if( proto != FLAG_MCA ) { |
@@ -460,10 +460,11 @@ size_t remove_peer_from_torrent( PROTO_FLAG proto, struct ot_workstruct *ws ) { | |||
460 | case 1: peer_list->peer_count--; /* Intentional fallthrough */ | 460 | case 1: peer_list->peer_count--; /* Intentional fallthrough */ |
461 | default: break; | 461 | default: break; |
462 | } | 462 | } |
463 | |||
464 | peer_count = torrent->peer_list6->peer_count + torrent->peer_list4->peer_count; | ||
465 | seed_count = torrent->peer_list6->seed_count + torrent->peer_list4->seed_count; | ||
463 | } | 466 | } |
464 | 467 | ||
465 | peer_count = torrent->peer_list6->peer_count + torrent->peer_list4->peer_count; | ||
466 | seed_count = torrent->peer_list6->seed_count + torrent->peer_list4->seed_count; | ||
467 | 468 | ||
468 | if( proto == FLAG_TCP ) { | 469 | if( proto == FLAG_TCP ) { |
469 | int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM; | 470 | int erval = OT_CLIENT_REQUEST_INTERVAL_RANDOM; |