소스 검색

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 년 전
부모
커밋
8090469c2a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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.