diff --git a/src/http.rs b/src/http.rs index 987b871874a3ad..0967bf3dd29f0f 100644 --- a/src/http.rs +++ b/src/http.rs @@ -10,22 +10,19 @@ use hyper::client::Client; use hyper::client::HttpConnector; use hyper::Uri; use hyper_rustls; -use std::sync::Mutex; -type HttpsConnector = hyper_rustls::HttpsConnector; +type Connector = hyper_rustls::HttpsConnector; lazy_static! { - static ref connector_mutex: Mutex = { - let num_dns_threads = 0; - Mutex::new(hyper_rustls::HttpsConnector::new(num_dns_threads)) + static ref connector: Connector = { + let num_dns_threads = 4; }; } -pub fn get_client() -> Client { +pub fn get_client() -> Client { // TODO use Hyper's connection pool. - //let connector = connector_mutex.lock().unwrap(); - let connector: HttpsConnector = hyper_rustls::HttpsConnector::new(4); - let client = Client::builder().build(connector); + let c = Connector::new(num_dns_threads); + let client = Client::builder().build(c); return client; }