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

fix: don't increment failure count when stopping torrent (#7238)

* fix: don't increment failure count when stopping torrent

* refactor: don't reset failure count on torrent stop
This commit is contained in:
Yat Ho 2024-11-09 02:42:59 +08:00 committed by GitHub
parent 6bf62959b4
commit 49f4c604da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -233,7 +233,7 @@ public:
// ---
constexpr auto set_connected(time_t now, bool is_connected = true) noexcept
constexpr auto set_connected(time_t now, bool is_connected = true, bool is_disconnecting = false) noexcept
{
if (is_connected_ == is_connected)
{
@ -252,7 +252,7 @@ public:
{
num_consecutive_fruitless_ = {};
}
else
else if (is_disconnecting)
{
on_fruitless_connection();
}

View file

@ -2094,7 +2094,7 @@ tr_peerMsgs::tr_peerMsgs(
tr_peerMsgs::~tr_peerMsgs()
{
peer_info->set_connected(tr_time(), false);
peer_info->set_connected(tr_time(), false, is_disconnecting());
TR_ASSERT(n_peers > 0U);
--n_peers;
}