Skip to content

Commit

Permalink
workaround for hyperium/hyper#2312
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuichi committed Nov 12, 2020
1 parent 834b4f6 commit f934777
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hyper_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ impl HyperClient {
#[cfg(unix)]
pub fn connect_with_unix(path: &str) -> Self {
let url = hyperlocal::Uri::new(path, "").into();
let client = hyper::Client::builder().build::<_, hyper::Body>(hyperlocal::UnixConnector);
// Prevent from using connection pooling.
// See https://github.com/hyperium/hyper/issues/2312.
let client: hyper::Client<_> = hyper::Client::builder()
.pool_idle_timeout(std::time::Duration::from_millis(0))
.pool_max_idle_per_host(0)
.build(hyperlocal::UnixConnector);
Self::new(Client::UnixClient(client), url)
}

Expand Down

0 comments on commit f934777

Please sign in to comment.