fix(client): detect connection closes as pool tries to use
Currently, if the remote closes the connection at the same time that the pool selects it to use for a new request, the connection may actually hang. This fix will now more allow the keep-alive read to check the socket even when the `Conn` think it's busy. If the connection was closed before the request write happened, returns back an `Error::Cancel`, letting the user know they could safely retry it. Closes #1439
This commit is contained in:
@@ -85,7 +85,7 @@ impl<T, U> Drop for Receiver<T, U> {
|
||||
// - Err: unreachable
|
||||
while let Ok(Async::Ready(Some((_val, cb)))) = self.inner.poll() {
|
||||
// maybe in future, we pass the value along with the error?
|
||||
let _ = cb.send(Err(::Error::new_canceled()));
|
||||
let _ = cb.send(Err(::Error::new_canceled(None)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user