Skip to content

Commit

Permalink
Document hazards of infinite idle timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith authored and djc committed Mar 11, 2020
1 parent 0ff3d8f commit f514595
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quinn-proto/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ impl TransportConfig {
///
/// The true idle timeout is the minimum of this and the peer's own max idle timeout. `None`
/// represents an infinite timeout.
///
/// **WARNING**: If a peer or its network path malfunctions or acts maliciously, an infinite
/// idle timeout can result in permanently hung futures!
pub fn max_idle_timeout(&mut self, value: Option<Duration>) -> Result<&mut Self, ConfigError> {
if value.map_or(false, |x| x.as_millis() > VarInt::MAX.0 as u128) {
return Err(ConfigError::OutOfBounds);
Expand Down

0 comments on commit f514595

Please sign in to comment.