disable Nagle's for default-tls handshake
This commit is contained in:
@@ -18,8 +18,8 @@ futures = "0.1.23"
|
|||||||
http = "0.1.15"
|
http = "0.1.15"
|
||||||
hyper = "0.12.22"
|
hyper = "0.12.22"
|
||||||
hyper-old-types = { version = "0.11", optional = true, features = ["compat"] }
|
hyper-old-types = { version = "0.11", optional = true, features = ["compat"] }
|
||||||
hyper-tls = { version = "0.3", optional = true }
|
|
||||||
flate2 = { version = "^1.0.7", default-features = false, features = ["rust_backend"] }
|
flate2 = { version = "^1.0.7", default-features = false, features = ["rust_backend"] }
|
||||||
|
hyper-tls = { version = "0.3.2", optional = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime = "0.3.7"
|
mime = "0.3.7"
|
||||||
mime_guess = "2.0.0-alpha.6"
|
mime_guess = "2.0.0-alpha.6"
|
||||||
|
|||||||
@@ -174,9 +174,20 @@ impl Connect for Connector {
|
|||||||
#[cfg(feature = "default-tls")]
|
#[cfg(feature = "default-tls")]
|
||||||
Inner::DefaultTls(http, tls) => {
|
Inner::DefaultTls(http, tls) => {
|
||||||
let mut http = http.clone();
|
let mut http = http.clone();
|
||||||
http.set_nodelay(nodelay);
|
|
||||||
|
http.set_nodelay(nodelay || ($dst.scheme() == "https"));
|
||||||
|
|
||||||
let http = ::hyper_tls::HttpsConnector::from((http, tls.clone()));
|
let http = ::hyper_tls::HttpsConnector::from((http, tls.clone()));
|
||||||
connect!(http, $dst, $proxy)
|
timeout!(http.connect($dst)
|
||||||
|
.and_then(move |(io, connected)| {
|
||||||
|
if let ::hyper_tls::MaybeHttpsStream::Https(stream) = &io {
|
||||||
|
if !nodelay {
|
||||||
|
stream.get_ref().get_ref().set_nodelay(false)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok((Box::new(io) as Conn, connected.proxy($proxy)))
|
||||||
|
}))
|
||||||
},
|
},
|
||||||
#[cfg(feature = "rustls-tls")]
|
#[cfg(feature = "rustls-tls")]
|
||||||
Inner::RustlsTls { http, tls, .. } => {
|
Inner::RustlsTls { http, tls, .. } => {
|
||||||
@@ -191,9 +202,8 @@ impl Connect for Connector {
|
|||||||
timeout!(http.connect($dst)
|
timeout!(http.connect($dst)
|
||||||
.and_then(move |(io, connected)| {
|
.and_then(move |(io, connected)| {
|
||||||
if let ::hyper_rustls::MaybeHttpsStream::Https(stream) = &io {
|
if let ::hyper_rustls::MaybeHttpsStream::Https(stream) = &io {
|
||||||
let (io, _) = stream.get_ref();
|
|
||||||
|
|
||||||
if !nodelay {
|
if !nodelay {
|
||||||
|
let (io, _) = stream.get_ref();
|
||||||
io.set_nodelay(false)?;
|
io.set_nodelay(false)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user