diff --git a/src/cargo/sources/registry/http_remote.rs b/src/cargo/sources/registry/http_remote.rs index 29ccf1f474f..16e47b8bf55 100644 --- a/src/cargo/sources/registry/http_remote.rs +++ b/src/cargo/sources/registry/http_remote.rs @@ -796,9 +796,6 @@ impl<'gctx> RegistryData for HttpRegistry<'gctx> { self.downloads.blocking_calls += 1; loop { - self.handle_completed_downloads()?; - self.add_sleepers()?; - let remaining_in_multi = tls::set(&self.downloads, || { self.multi .perform() @@ -806,6 +803,9 @@ impl<'gctx> RegistryData for HttpRegistry<'gctx> { })?; trace!(target: "network", "{} transfers remaining", remaining_in_multi); + self.handle_completed_downloads()?; + self.add_sleepers()?; + if remaining_in_multi + self.downloads.sleeping.len() as u32 == 0 { return Ok(()); }