mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 16:55:08 +02:00
update to latest actix-net
This commit is contained in:
@ -5,9 +5,8 @@ use std::task::{Context, Poll};
|
||||
use std::time::Instant;
|
||||
use std::{fmt, io, net};
|
||||
|
||||
use actix_codec::{AsyncRead, Decoder, Encoder, Framed, FramedParts};
|
||||
use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed, FramedParts};
|
||||
use actix_rt::time::{delay, Delay};
|
||||
use actix_server_config::IoStream;
|
||||
use actix_service::Service;
|
||||
use bitflags::bitflags;
|
||||
use bytes::{BufMut, BytesMut};
|
||||
@ -168,7 +167,7 @@ impl PartialEq for PollResponse {
|
||||
|
||||
impl<T, S, B, X, U> Dispatcher<T, S, B, X, U>
|
||||
where
|
||||
T: IoStream,
|
||||
T: AsyncRead + AsyncWrite + Unpin,
|
||||
S: Service<Request = Request>,
|
||||
S::Error: Into<Error>,
|
||||
S::Response: Into<Response<B>>,
|
||||
@ -186,6 +185,7 @@ where
|
||||
expect: CloneableService<X>,
|
||||
upgrade: Option<CloneableService<U>>,
|
||||
on_connect: Option<Box<dyn DataFactory>>,
|
||||
peer_addr: Option<net::SocketAddr>,
|
||||
) -> Self {
|
||||
Dispatcher::with_timeout(
|
||||
stream,
|
||||
@ -197,6 +197,7 @@ where
|
||||
expect,
|
||||
upgrade,
|
||||
on_connect,
|
||||
peer_addr,
|
||||
)
|
||||
}
|
||||
|
||||
@ -211,6 +212,7 @@ where
|
||||
expect: CloneableService<X>,
|
||||
upgrade: Option<CloneableService<U>>,
|
||||
on_connect: Option<Box<dyn DataFactory>>,
|
||||
peer_addr: Option<net::SocketAddr>,
|
||||
) -> Self {
|
||||
let keepalive = config.keep_alive_enabled();
|
||||
let flags = if keepalive {
|
||||
@ -234,7 +236,6 @@ where
|
||||
payload: None,
|
||||
state: State::None,
|
||||
error: None,
|
||||
peer_addr: io.peer_addr(),
|
||||
messages: VecDeque::new(),
|
||||
io,
|
||||
codec,
|
||||
@ -244,6 +245,7 @@ where
|
||||
upgrade,
|
||||
on_connect,
|
||||
flags,
|
||||
peer_addr,
|
||||
ka_expire,
|
||||
ka_timer,
|
||||
}),
|
||||
@ -253,7 +255,7 @@ where
|
||||
|
||||
impl<T, S, B, X, U> InnerDispatcher<T, S, B, X, U>
|
||||
where
|
||||
T: IoStream,
|
||||
T: AsyncRead + AsyncWrite + Unpin,
|
||||
S: Service<Request = Request>,
|
||||
S::Error: Into<Error>,
|
||||
S::Response: Into<Response<B>>,
|
||||
@ -682,7 +684,7 @@ where
|
||||
|
||||
impl<T, S, B, X, U> Unpin for Dispatcher<T, S, B, X, U>
|
||||
where
|
||||
T: IoStream,
|
||||
T: AsyncRead + AsyncWrite + Unpin,
|
||||
S: Service<Request = Request>,
|
||||
S::Error: Into<Error>,
|
||||
S::Response: Into<Response<B>>,
|
||||
@ -696,7 +698,7 @@ where
|
||||
|
||||
impl<T, S, B, X, U> Future for Dispatcher<T, S, B, X, U>
|
||||
where
|
||||
T: IoStream,
|
||||
T: AsyncRead + AsyncWrite + Unpin,
|
||||
S: Service<Request = Request>,
|
||||
S::Error: Into<Error>,
|
||||
S::Response: Into<Response<B>>,
|
||||
@ -907,6 +909,7 @@ mod tests {
|
||||
CloneableService::new(ExpectHandler),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
match Pin::new(&mut h1).poll(cx) {
|
||||
Poll::Pending => panic!(),
|
||||
|
Reference in New Issue
Block a user