From e0c459e9f5183400c0fc0c2f1cdf5dd1bf9cc46f Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Mon, 19 Aug 2024 16:51:50 +0100 Subject: [PATCH] Fix unchoke broken in previous PR --- crates/librqbit/src/torrent_state/live/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/librqbit/src/torrent_state/live/mod.rs b/crates/librqbit/src/torrent_state/live/mod.rs index 9d15dbf..7d913fe 100644 --- a/crates/librqbit/src/torrent_state/live/mod.rs +++ b/crates/librqbit/src/torrent_state/live/mod.rs @@ -1223,8 +1223,6 @@ impl PeerHandler { }; loop { - aframe!(self.wait_for_unchoke()).await; - // If we have full torrent, we don't need to request more pieces. // However we might still need to seed them to the peer. if self.state.is_finished_and_no_active_streams() { @@ -1244,6 +1242,7 @@ impl PeerHandler { } update_interest(self, true)?; + aframe!(self.wait_for_unchoke()).await; // Try steal a pice from a very slow peer first. Otherwise we might wait too long // to download early pieces.