1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 17:46:38 +02:00

add client shutdown timeout

This commit is contained in:
Nikolay Kim
2018-10-01 20:04:16 -07:00
parent 91af3ca148
commit 16945a554a
9 changed files with 208 additions and 38 deletions

View File

@@ -176,11 +176,11 @@ where
/// Applies timeout to request prcoessing.
pub(crate) struct AcceptorTimeout<T> {
inner: T,
timeout: usize,
timeout: u64,
}
impl<T: NewService> AcceptorTimeout<T> {
pub(crate) fn new(timeout: usize, inner: T) -> Self {
pub(crate) fn new(timeout: u64, inner: T) -> Self {
Self { inner, timeout }
}
}
@@ -204,7 +204,7 @@ impl<T: NewService> NewService for AcceptorTimeout<T> {
#[doc(hidden)]
pub(crate) struct AcceptorTimeoutFut<T: NewService> {
fut: T::Future,
timeout: usize,
timeout: u64,
}
impl<T: NewService> Future for AcceptorTimeoutFut<T> {
@@ -215,7 +215,7 @@ impl<T: NewService> Future for AcceptorTimeoutFut<T> {
let inner = try_ready!(self.fut.poll());
Ok(Async::Ready(AcceptorTimeoutService {
inner,
timeout: self.timeout as u64,
timeout: self.timeout,
}))
}
}