From 785d02fc9732a93d4da07a12d3734f01a236750c 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 | 3 +++ actix-http/src/h1/payload.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index dc0a02730..c4a732248 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,9 @@ ## Unreleased +### Fixed +- Fix bug which prevents end-users from discovering when the remote peer has closed its side of the TCP connection. + ## 3.11.0 - Update `brotli` dependency to `8`. 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]