diff --git a/client/http-client/src/transport.rs b/client/http-client/src/transport.rs index c638b85439..f1804dc7aa 100644 --- a/client/http-client/src/transport.rs +++ b/client/http-client/src/transport.rs @@ -57,24 +57,32 @@ impl HttpTransportClient { return Err(Error::Url("Port number is missing in the URL".into())); } + let mut connector = HttpConnector::new(); + + connector.set_reuse_address(true); + connector.set_nodelay(true); + let client = match target.scheme_str() { Some("http") => { - let connector = HttpConnector::new(); let client = Client::builder().build::<_, hyper::Body>(connector); HyperClient::Http(client) } #[cfg(feature = "tls")] Some("https") => { let connector = match cert_store { - CertificateStore::Native => { - hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1() - } - CertificateStore::WebPki => { - hyper_rustls::HttpsConnectorBuilder::new().with_webpki_roots().https_or_http().enable_http1() - } + CertificateStore::Native => hyper_rustls::HttpsConnectorBuilder::new() + .with_native_roots() + .https_or_http() + .enable_http1() + .wrap_connector(connector), + CertificateStore::WebPki => hyper_rustls::HttpsConnectorBuilder::new() + .with_webpki_roots() + .https_or_http() + .enable_http1() + .wrap_connector(connector), _ => return Err(Error::InvalidCertficateStore), }; - let client = Client::builder().build::<_, hyper::Body>(connector.build()); + let client = Client::builder().build::<_, hyper::Body>(connector); HyperClient::Https(client) } _ => { @@ -132,7 +140,7 @@ pub enum Error { Url(String), /// Error during the HTTP request, including networking errors and HTTP protocol errors. - #[error("Error while performing the HTTP request")] + #[error("HTTP error: {0}")] Http(Box), /// Server returned a non-success status code. diff --git a/proc-macros/src/visitor.rs b/proc-macros/src/visitor.rs index c77ef9f993..0315d826ef 100644 --- a/proc-macros/src/visitor.rs +++ b/proc-macros/src/visitor.rs @@ -168,9 +168,7 @@ impl FindSubscriptionParams { syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {} - #[cfg(test)] - syn::Type::__TestExhaustive(_) => unimplemented!(), - #[cfg(not(test))] + #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } }