Enable HTTP connection pooling. Retry stale connections indicated by connection reset errors.

This commit is contained in:
Josh Matthews 2017-04-04 19:40:46 -04:00
parent 5421d833de
commit 6079dd4de7
2 changed files with 4 additions and 3 deletions

View file

@ -487,7 +487,9 @@ fn obtain_response(request_factory: &NetworkHttpRequestFactory,
let response = match request_writer.send() {
Ok(w) => w,
Err(HttpError::Io(ref io_error)) if io_error.kind() == io::ErrorKind::ConnectionAborted => {
Err(HttpError::Io(ref io_error))
if io_error.kind() == io::ErrorKind::ConnectionAborted ||
io_error.kind() == io::ErrorKind::ConnectionReset => {
debug!("connection aborted ({:?}), possibly stale, trying new connection", io_error.description());
continue;
},