From fd7bb4a2874f655a925feaff21fbd9c4fa0de986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=20C=C5=93ur?= Date: Mon, 7 Nov 2022 14:15:35 +0800 Subject: [PATCH] Fix "upload/download connectivity is broken" (#4107) --- libtransmission/peer-mgr.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libtransmission/peer-mgr.cc b/libtransmission/peer-mgr.cc index 80ac4f252..9858bd80a 100644 --- a/libtransmission/peer-mgr.cc +++ b/libtransmission/peer-mgr.cc @@ -565,7 +565,7 @@ struct tr_peerMgr explicit tr_peerMgr(tr_session* session_in) : session{ session_in } , bandwidth_timer_{ session->timerMaker().create([this]() { bandwidthPulse(); }) } - , rechoke_timer_{ session->timerMaker().create([this]() { rechokePulse(); }) } + , rechoke_timer_{ session->timerMaker().create([this]() { rechokePulseMarshall(); }) } , refill_upkeep_timer_{ session->timerMaker().create([this]() { refillUpkeep(); }) } { bandwidth_timer_->startRepeating(BandwidthPeriod); @@ -604,6 +604,12 @@ struct tr_peerMgr Handshakes incoming_handshakes; private: + void rechokePulseMarshall() + { + rechokePulse(); + rechoke_timer_->startSingleShot(RechokePeriod); + } + std::unique_ptr const bandwidth_timer_; std::unique_ptr const rechoke_timer_; std::unique_ptr const refill_upkeep_timer_;