feat(client): implement the HTTP/2 extended CONNECT protocol from RFC 8441 (#2682)

This commit is contained in:
Anthony Ramine
2022-02-08 02:35:34 +01:00
committed by GitHub
parent 6932896a7f
commit 5ec094caa5
7 changed files with 120 additions and 3 deletions

View File

@@ -487,6 +487,23 @@ where
Poll::Ready(Ok(conn.take().unwrap().into_parts()))
})
}
/// Returns whether the [extended CONNECT protocol][1] is enabled or not.
///
/// This setting is configured by the server peer by sending the
/// [`SETTINGS_ENABLE_CONNECT_PROTOCOL` parameter][2] in a `SETTINGS` frame.
/// This method returns the currently acknowledged value recieved from the
/// remote.
///
/// [1]: https://datatracker.ietf.org/doc/html/rfc8441#section-4
/// [2]: https://datatracker.ietf.org/doc/html/rfc8441#section-3
#[cfg(feature = "http2")]
pub fn http2_is_extended_connect_protocol_enabled(&self) -> bool {
match self.inner.as_ref().unwrap() {
ProtoClient::H1 { .. } => false,
ProtoClient::H2 { h2 } => h2.is_extended_connect_protocol_enabled(),
}
}
}
impl<T, B> Future for Connection<T, B>