diff --git a/Cargo.toml b/Cargo.toml index 31ac0356f5..ef46ef59b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ http = "0.2" http-body = "0.4" httpdate = "0.3" httparse = "1.0" -h2 = { version = "0.3", optional = true } +h2 = { version = "0.3.1", optional = true } itoa = "0.4.1" tracing = { version = "0.1", default-features = false, features = ["std"] } pin-project = "1.0" diff --git a/src/proto/h2/client.rs b/src/proto/h2/client.rs index 4f583f2bfa..445aa41cb1 100644 --- a/src/proto/h2/client.rs +++ b/src/proto/h2/client.rs @@ -7,6 +7,7 @@ use futures_util::future::{self, Either, FutureExt as _, TryFutureExt as _}; use futures_util::stream::StreamExt as _; use h2::client::{Builder, SendRequest}; use tokio::io::{AsyncRead, AsyncWrite}; +use tracing::debug; use super::{decode_content_length, ping, PipeToSendStream, SendBuf}; use crate::body::HttpBody; @@ -105,6 +106,11 @@ where .await .map_err(crate::Error::new_h2)?; + debug!( + server.max_concurrent_send_streams = conn.max_concurrent_send_streams(), + "HTTP/2 handshake complete" + ); + // An mpsc channel is used entirely to detect when the // 'Client' has been dropped. This is to get around a bug // in h2 where dropping all SendRequests won't notify a diff --git a/src/proto/h2/server.rs b/src/proto/h2/server.rs index eea52e3e4b..6e2dca0227 100644 --- a/src/proto/h2/server.rs +++ b/src/proto/h2/server.rs @@ -7,6 +7,7 @@ use h2::server::{Connection, Handshake, SendResponse}; use h2::Reason; use pin_project::pin_project; use tokio::io::{AsyncRead, AsyncWrite}; +use tracing::debug; use super::{decode_content_length, ping, PipeToSendStream, SendBuf}; use crate::body::HttpBody; @@ -136,6 +137,8 @@ where } } + pub(crate ) + pub(crate) fn graceful_shutdown(&mut self) { trace!("graceful_shutdown"); match self.state { @@ -175,6 +178,10 @@ where ref ping_config, } => { let mut conn = ready!(Pin::new(hs).poll(cx).map_err(crate::Error::new_h2))?; + debug!( + client.max_concurrent_recv_streams = conn.max_concurrent_recv_streams(), + "HTTP/2 handshake complete" + ); let ping = if ping_config.is_enabled() { let pp = conn.ping_pong().expect("conn.ping_pong"); Some(ping::channel(pp, ping_config.clone()))