1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-28 07:47:49 +02:00

refactor h1 dispatcher

This commit is contained in:
Nikolay Kim
2019-04-06 00:16:04 -07:00
parent fbedaec661
commit 3872d3ba5a
8 changed files with 275 additions and 168 deletions

View File

@@ -1,7 +1,7 @@
use std::marker::PhantomData;
use std::{fmt, io};
use actix_codec::{AsyncRead, AsyncWrite, Framed, FramedParts};
use actix_codec::{AsyncRead, AsyncWrite};
use actix_server_config::{Io as ServerIo, Protocol, ServerConfig as SrvConfig};
use actix_service::{IntoNewService, NewService, Service};
use actix_utils::cloneable::CloneableService;
@@ -375,13 +375,14 @@ where
self.state =
State::Handshake(Some((server::handshake(io), cfg, srv)));
} else {
let framed = Framed::from_parts(FramedParts::with_read_buf(
self.state = State::H1(h1::Dispatcher::with_timeout(
io,
h1::Codec::new(cfg.clone()),
cfg,
buf,
));
self.state = State::H1(h1::Dispatcher::with_timeout(
framed, cfg, None, srv, expect,
None,
srv,
expect,
))
}
self.poll()