mirror of
https://github.com/rust-lang/cargo
synced 2024-08-28 19:59:27 +00:00
Auto merge of #10456 - hi-rustin:rustin-patch-network, r=alexcrichton
Wait up to one second while waiting for curl ### What does this PR try to resolve? close https://github.com/rust-lang/cargo/issues/8516 Wait up to one second while waiting for curl. ### How should we test and review this PR? 1. Build cargo 2. Start a network transfer (cargo fetch). 3. Pull the network cord. 4. Wait.
This commit is contained in:
commit
c5cdd25c14
|
@ -1000,11 +1000,9 @@ impl<'a, 'cfg> Downloads<'a, 'cfg> {
|
||||||
break Ok(pair);
|
break Ok(pair);
|
||||||
}
|
}
|
||||||
assert!(!self.pending.is_empty());
|
assert!(!self.pending.is_empty());
|
||||||
let timeout = self
|
let min_timeout = Duration::new(1, 0);
|
||||||
.set
|
let timeout = self.set.multi.get_timeout()?.unwrap_or(min_timeout);
|
||||||
.multi
|
let timeout = timeout.min(min_timeout);
|
||||||
.get_timeout()?
|
|
||||||
.unwrap_or_else(|| Duration::new(5, 0));
|
|
||||||
self.set
|
self.set
|
||||||
.multi
|
.multi
|
||||||
.wait(&mut [], timeout)
|
.wait(&mut [], timeout)
|
||||||
|
|
Loading…
Reference in a new issue