Skip to content

Commit

Permalink
Enable HTTP connection pooling. Retry stale connections indicated by …
Browse files Browse the repository at this point in the history
…connection reset errors.
  • Loading branch information
jdm committed Apr 4, 2017
1 parent 5421d83 commit 6079dd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion components/net/http_loader.rs
Expand Up @@ -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;
},
Expand Down
3 changes: 1 addition & 2 deletions components/net/resource_thread.rs
Expand Up @@ -330,8 +330,7 @@ impl CoreResourceManager {
let ua = self.user_agent.clone();
let dc = self.devtools_chan.clone();
let filemanager = self.filemanager.clone();
// FIXME(#15694): use group.connector.clone() instead.
let connector = create_http_connector(group.ssl_client.clone());
let connector = group.connector.clone();

thread::Builder::new().name(format!("fetch thread for {}", init.url)).spawn(move || {
let mut request = Request::from_init(init);
Expand Down

0 comments on commit 6079dd4

Please sign in to comment.