Update ntex-h2 dep

This commit is contained in:
Nikolay Kim 2024-03-12 17:20:51 +05:00
parent 3bd15f633f
commit 5d4da464ac
6 changed files with 27 additions and 28 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "ntex"
version = "1.1.1"
version = "1.1.2"
authors = ["ntex contributors <team@ntex.rs>"]
description = "Framework for composable network services"
readme = "README.md"
@ -56,7 +56,7 @@ ntex-service = "2.0.1"
ntex-macros = "0.1.3"
ntex-util = "1.0.1"
ntex-bytes = "0.1.24"
ntex-h2 = "0.5.0"
ntex-h2 = "0.5.1"
ntex-rt = "0.4.11"
ntex-io = "1.0.1"
ntex-tls = "1.0.0"

View file

@ -52,7 +52,7 @@ where
C1: ServiceFactory<h1::Control<F, S::Error>, Response = h1::ControlAck>,
C1::Error: Error,
C1::InitError: fmt::Debug,
C2: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>,
C2: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck>,
C2::Error: Error,
C2::InitError: fmt::Debug,
{
@ -167,8 +167,8 @@ where
/// Provide control service for http/2 protocol.
pub fn h2_control<CF, CT>(self, control: CF) -> HttpServiceBuilder<F, S, C1, CT>
where
CF: IntoServiceFactory<CT, h2::ControlMessage<H2Error>>,
CT: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>,
CF: IntoServiceFactory<CT, h2::Control<H2Error>>,
CT: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck>,
CT::Error: Error,
CT::InitError: fmt::Debug,
{

View file

@ -9,8 +9,8 @@ use crate::service::{Service, ServiceCtx, ServiceFactory};
/// Default control service
pub struct DefaultControlService;
impl ServiceFactory<h2::ControlMessage<H2Error>> for DefaultControlService {
type Response = h2::ControlResult;
impl ServiceFactory<h2::Control<H2Error>> for DefaultControlService {
type Response = h2::ControlAck;
type Error = io::Error;
type Service = DefaultControlService;
type InitError = io::Error;
@ -20,13 +20,13 @@ impl ServiceFactory<h2::ControlMessage<H2Error>> for DefaultControlService {
}
}
impl Service<h2::ControlMessage<H2Error>> for DefaultControlService {
type Response = h2::ControlResult;
impl Service<h2::Control<H2Error>> for DefaultControlService {
type Response = h2::ControlAck;
type Error = io::Error;
async fn call(
&self,
msg: h2::ControlMessage<H2Error>,
msg: h2::Control<H2Error>,
_: ServiceCtx<'_, Self>,
) -> Result<Self::Response, Self::Error> {
log::trace!("HTTP/2 Control message: {:?}", msg);

View file

@ -3,7 +3,10 @@ mod default;
pub(super) mod payload;
mod service;
pub use ntex_h2::{Config, ControlMessage, ControlResult};
pub use ntex_h2::{Config, Control, ControlAck};
#[doc(hidden)]
pub use ntex_h2::{ControlMessage, ControlResult};
pub use self::default::DefaultControlService;
pub use self::payload::Payload;

View file

@ -62,8 +62,7 @@ mod openssl {
S::InitError: fmt::Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
C: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>
+ 'static,
C: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C::Error: Error,
C::InitError: fmt::Debug,
{
@ -102,8 +101,7 @@ mod rustls {
S::InitError: fmt::Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
C: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>
+ 'static,
C: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C::Error: Error,
C::InitError: fmt::Debug,
{
@ -137,14 +135,14 @@ where
S::Error: ResponseError,
S::InitError: fmt::Debug,
B: MessageBody,
C: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>,
C: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck>,
C::Error: Error,
C::InitError: fmt::Debug,
{
/// Provide http/2 control service
pub fn control<CT>(self, ctl: CT) -> H2Service<F, S, B, CT>
where
CT: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>,
CT: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck>,
CT::Error: Error,
CT::InitError: fmt::Debug,
{
@ -165,7 +163,7 @@ where
S::InitError: fmt::Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
C: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult> + 'static,
C: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C::Error: Error,
C::InitError: fmt::Debug,
{
@ -204,7 +202,7 @@ where
S::Error: ResponseError,
S::Response: Into<Response<B>>,
B: MessageBody,
C: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult> + 'static,
C: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C::Error: Error,
C::InitError: fmt::Debug,
{
@ -251,7 +249,7 @@ where
S::Error: ResponseError,
S::Response: Into<Response<B>>,
B: MessageBody,
C2: Service<h2::ControlMessage<H2Error>, Response = h2::ControlResult> + 'static,
C2: Service<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C2::Error: Error,
{
io.set_disconnect_timeout(config.client_disconnect);

View file

@ -94,7 +94,7 @@ where
C1: ServiceFactory<h1::Control<F, S::Error>, Response = h1::ControlAck>,
C1::Error: error::Error,
C1::InitError: fmt::Debug,
C2: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>,
C2: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck>,
C2::Error: error::Error,
C2::InitError: fmt::Debug,
{
@ -117,7 +117,7 @@ where
/// Provide http/1 control service.
pub fn h2_control<CT>(self, control: CT) -> HttpService<F, S, B, C1, CT>
where
CT: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>,
CT: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck>,
CT::Error: error::Error,
CT::InitError: fmt::Debug,
{
@ -153,8 +153,7 @@ mod openssl {
> + 'static,
C1::Error: error::Error,
C1::InitError: fmt::Debug,
C2: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>
+ 'static,
C2: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C2::Error: error::Error,
C2::InitError: fmt::Debug,
{
@ -199,8 +198,7 @@ mod rustls {
> + 'static,
C1::Error: error::Error,
C1::InitError: fmt::Debug,
C2: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult>
+ 'static,
C2: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C2::Error: error::Error,
C2::InitError: fmt::Debug,
{
@ -237,7 +235,7 @@ where
C1: ServiceFactory<h1::Control<F, S::Error>, Response = h1::ControlAck> + 'static,
C1::Error: error::Error,
C1::InitError: fmt::Debug,
C2: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult> + 'static,
C2: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C2::Error: error::Error,
C2::InitError: fmt::Debug,
{
@ -284,7 +282,7 @@ where
B: MessageBody,
C1: Service<h1::Control<F, S::Error>, Response = h1::ControlAck> + 'static,
C1::Error: error::Error,
C2: ServiceFactory<h2::ControlMessage<H2Error>, Response = h2::ControlResult> + 'static,
C2: ServiceFactory<h2::Control<H2Error>, Response = h2::ControlAck> + 'static,
C2::Error: error::Error,
C2::InitError: fmt::Debug,
{