Skip to content

Commit

Permalink
Fix possible hang from hyper-util
Browse files Browse the repository at this point in the history
  • Loading branch information
kushudai committed Jun 26, 2024
1 parent 0264a20 commit f800ef5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,21 @@ pub struct Config {
}

fn default_builder() -> Builder {
// https://github.com/hyperium/hyper/issues/2312
Builder::new(hyper_util::rt::TokioExecutor::new())
.pool_idle_timeout(std::time::Duration::from_millis(0))
.pool_max_idle_per_host(0)
.to_owned()
}

impl Default for Config {
fn default() -> Self {
Config {
address: String::default(),
token: None,
hyper_builder: default_builder(),
}
}
}

impl Config {
Expand Down

0 comments on commit f800ef5

Please sign in to comment.