1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

fix: don't consider peer info inactive if any of the time values is 0 (#6606)

This commit is contained in:
Yat Ho 2024-02-18 13:46:02 +08:00 committed by GitHub
parent d11cddc39a
commit 348177863a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -311,7 +311,7 @@ public:
[[nodiscard]] auto is_inactive(time_t const now) const noexcept
{
return !is_in_use() && now - connection_changed_at_ >= UselessThresSecs;
return !is_in_use() && now > 0 && connection_changed_at_ > 0 && now - connection_changed_at_ >= InactiveThresSecs;
}
// ---
@ -431,7 +431,7 @@ private:
// the minimum we'll wait before attempting to reconnect to a peer
static auto constexpr MinimumReconnectIntervalSecs = time_t{ 5U };
static auto constexpr UselessThresSecs = time_t{ 24 * 60 * 60 };
static auto constexpr InactiveThresSecs = time_t{ 24 * 60 * 60 };
static auto inline n_known_connectable = size_t{};