Prechádzať zdrojové kódy

fix return value of `nagle_enable`

The old implementation returns the wrong value (ACK delay duration)
and doesn't describe if the Nagle algorithm is enabled or not.
Stefan Lankes 2 rokov pred
rodič
commit
011ce6751e
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/socket/tcp.rs

+ 2 - 2
src/socket/tcp.rs

@@ -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.