From ffa150ba8217b83aae768d607e9d57e4f8e6bca9 Mon Sep 17 00:00:00 2001 From: Alex Wied <543423+centromere@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:15:25 -0400 Subject: [PATCH] Wake Future when EOF is received When a TCP FIN is received, the Future needs to be awakened. Without this, it is not possible to detect a connection closure in end-user applications. --- actix-http/CHANGES.md | 1 + actix-http/src/h1/payload.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 982add26a..d4b919513 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -5,6 +5,7 @@ ### Added - Add `header::CLEAR_SITE_DATA` constant. +- Fix bug which prevents end-users from discovering when the remote peer has closed its side of the TCP connection. ### Changed diff --git a/actix-http/src/h1/payload.rs b/actix-http/src/h1/payload.rs index 2ad3a14a3..c473800c0 100644 --- a/actix-http/src/h1/payload.rs +++ b/actix-http/src/h1/payload.rs @@ -205,6 +205,7 @@ impl Inner { #[inline] fn feed_eof(&mut self) { self.eof = true; + self.wake(); } #[inline]