Skip to content

Commit 84881c9

Browse files
authored
feat(server): backport the split server conn modules from 1.0 (#3102)
Closes #3079
1 parent 0368a41 commit 84881c9

File tree

4 files changed

+853
-2
lines changed

4 files changed

+853
-2
lines changed

src/server/conn.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ use crate::error::{Kind, Parse};
5858
#[cfg(feature = "http1")]
5959
use crate::upgrade::Upgraded;
6060

61+
#[cfg(all(feature = "backports", feature = "http1"))]
62+
pub mod http1;
63+
#[cfg(all(feature = "backports", feature = "http2"))]
64+
pub mod http2;
65+
6166
cfg_feature! {
6267
#![any(feature = "http1", feature = "http2")]
6368

@@ -327,7 +332,7 @@ impl<E> Http<E> {
327332
self
328333
}
329334

330-
/// Set a timeout for reading client request headers. If a client does not
335+
/// Set a timeout for reading client request headers. If a client does not
331336
/// transmit the entire header within this time, the connection is closed.
332337
///
333338
/// Default is None.
@@ -809,7 +814,12 @@ where
809814
let mut conn = Some(self);
810815
futures_util::future::poll_fn(move |cx| {
811816
ready!(conn.as_mut().unwrap().poll_without_shutdown(cx))?;
812-
Poll::Ready(conn.take().unwrap().try_into_parts().ok_or_else(crate::Error::new_without_shutdown_not_h1))
817+
Poll::Ready(
818+
conn.take()
819+
.unwrap()
820+
.try_into_parts()
821+
.ok_or_else(crate::Error::new_without_shutdown_not_h1),
822+
)
813823
})
814824
}
815825

0 commit comments

Comments
 (0)