mirror of
https://github.com/servo/servo.git
synced 2025-09-20 11:50:09 +01:00
Enable HTTP connection pooling. Retry stale connections indicated by connection reset errors.
This commit is contained in:
parent
5421d833de
commit
6079dd4de7
2 changed files with 4 additions and 3 deletions
|
@ -487,7 +487,9 @@ fn obtain_response(request_factory: &NetworkHttpRequestFactory,
|
||||||
|
|
||||||
let response = match request_writer.send() {
|
let response = match request_writer.send() {
|
||||||
Ok(w) => w,
|
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());
|
debug!("connection aborted ({:?}), possibly stale, trying new connection", io_error.description());
|
||||||
continue;
|
continue;
|
||||||
},
|
},
|
||||||
|
|
|
@ -330,8 +330,7 @@ impl CoreResourceManager {
|
||||||
let ua = self.user_agent.clone();
|
let ua = self.user_agent.clone();
|
||||||
let dc = self.devtools_chan.clone();
|
let dc = self.devtools_chan.clone();
|
||||||
let filemanager = self.filemanager.clone();
|
let filemanager = self.filemanager.clone();
|
||||||
// FIXME(#15694): use group.connector.clone() instead.
|
let connector = group.connector.clone();
|
||||||
let connector = create_http_connector(group.ssl_client.clone());
|
|
||||||
|
|
||||||
thread::Builder::new().name(format!("fetch thread for {}", init.url)).spawn(move || {
|
thread::Builder::new().name(format!("fetch thread for {}", init.url)).spawn(move || {
|
||||||
let mut request = Request::from_init(init);
|
let mut request = Request::from_init(init);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue