diff options
Diffstat (limited to 'src/ot_clean.c')
| -rw-r--r-- | src/ot_clean.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ot_clean.c b/src/ot_clean.c index 77cb4ba..9e2186f 100644 --- a/src/ot_clean.c +++ b/src/ot_clean.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include "ot_vector.h" | 16 | #include "ot_vector.h" |
| 17 | #include "trackerlogic.h" | 17 | #include "trackerlogic.h" |
| 18 | 18 | ||
| 19 | ot_time g_empty_torrent_timeout = OT_TORRENT_TIMEOUT; | ||
| 20 | |||
| 19 | /* Returns amount of removed peers */ | 21 | /* Returns amount of removed peers */ |
| 20 | static ssize_t clean_single_bucket(ot_peer *peers, size_t peer_count, size_t peer_size, time_t timedout, size_t *removed_seeders) { | 22 | static ssize_t clean_single_bucket(ot_peer *peers, size_t peer_count, size_t peer_size, time_t timedout, size_t *removed_seeders) { |
| 21 | ot_peer *last_peer, *insert_point; | 23 | ot_peer *last_peer, *insert_point; |
| @@ -106,7 +108,7 @@ int clean_single_torrent(ot_torrent *torrent) { | |||
| 106 | /* Already empty and nothing arrived before the peer timeout: keep it only | 108 | /* Already empty and nothing arrived before the peer timeout: keep it only |
| 107 | while a down count is worth remembering */ | 109 | while a down count is worth remembering */ |
| 108 | if (timedout > OT_PEER_TIMEOUT && !torrent->peer_list6 && !torrent->peer_list4) | 110 | if (timedout > OT_PEER_TIMEOUT && !torrent->peer_list6 && !torrent->peer_list4) |
| 109 | return torrent->down_count ? 0 : 1; | 111 | return (torrent->down_count && timedout <= g_empty_torrent_timeout) ? 0 : 1; |
| 110 | 112 | ||
| 111 | /* Peers past the peer timeout are gone regardless, which caps how far the | 113 | /* Peers past the peer timeout are gone regardless, which caps how far the |
| 112 | lists are aged in this pass */ | 114 | lists are aged in this pass */ |
