浏览代码

Merge pull request #788 from mkj/abort-wake

tcp: Perform a reset() after an abort()
Dario Nieuwenhuis 1 年之前
父节点
当前提交
88aa133658
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/socket/tcp.rs

+ 5 - 0
src/socket/tcp.rs

@@ -2281,6 +2281,11 @@ impl<'a> Socket<'a> {
         if self.state == State::Closed {
             // When aborting a connection, forget about it after sending a single RST packet.
             self.tuple = None;
+            #[cfg(feature = "async")]
+            {
+                // Wake tx now so that async users can wait for the RST to be sent
+                self.tx_waker.wake();
+            }
         }
 
         Ok(())