mirror of https://github.com/rwf2/Rocket.git
Set reasonable read/write timeouts.
This commit is contained in:
parent
4683407f59
commit
2162a72114
|
@ -713,6 +713,10 @@ impl Rocket {
|
||||||
let timeout = self.config.keep_alive.map(|s| Duration::from_secs(s as u64));
|
let timeout = self.config.keep_alive.map(|s| Duration::from_secs(s as u64));
|
||||||
server.keep_alive(timeout);
|
server.keep_alive(timeout);
|
||||||
|
|
||||||
|
// Set sane timeouts.
|
||||||
|
server.set_read_timeout(Some(Duration::from_secs(10)));
|
||||||
|
server.set_write_timeout(Some(Duration::from_secs(10)));
|
||||||
|
|
||||||
// Freeze managed state for synchronization-free accesses later.
|
// Freeze managed state for synchronization-free accesses later.
|
||||||
self.state.freeze();
|
self.state.freeze();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue