Skip to content

Commit

Permalink
fix return value of nagle_enable
Browse files Browse the repository at this point in the history
The old implementation returns the wrong value (ACK delay duration)
and doesn't describe if the Nagle algorithm is enabled or not.
  • Loading branch information
stlankes authored and Dirbaio committed Nov 27, 2022
1 parent 6f3ea00 commit 011ce67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/socket/tcp.rs
Expand Up @@ -501,8 +501,8 @@ impl<'a> TcpSocket<'a> {
/// Return whether Nagle's Algorithm is enabled.
///
/// See also the [set_nagle_enabled](#method.set_nagle_enabled) method.
pub fn nagle_enabled(&self) -> Option<Duration> {
self.ack_delay
pub fn nagle_enabled(&self) -> bool {
self.nagle
}

/// Return the current window field value, including scaling according to RFC 1323.
Expand Down

0 comments on commit 011ce67

Please sign in to comment.