1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

fix client timer and add slow request tests

This commit is contained in:
Nikolay Kim
2018-10-02 00:19:28 -07:00
parent f007860a16
commit f3ce6574e4
8 changed files with 144 additions and 54 deletions

View File

@@ -232,6 +232,16 @@ impl<H: 'static> WorkerSettings<H> {
}
}
/// Client timeout for first request.
pub fn client_timer_expire(&self) -> Option<Instant> {
let delay = self.0.client_timeout;
if delay != 0 {
Some(self.now() + Duration::from_millis(delay))
} else {
None
}
}
/// Client shutdown timer
pub fn client_shutdown_timer(&self) -> Option<Instant> {
let delay = self.0.client_shutdown;