Explorar o código

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 %!s(int64=2) %!d(string=hai) anos
pai
achega
8090469c2a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/socket/tcp.rs

+ 2 - 2
src/socket/tcp.rs

@@ -541,8 +541,8 @@ impl<'a> Socket<'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.