From edc0c1926cb532d5ac2d386a46696bfcb246b32b Mon Sep 17 00:00:00 2001 From: Thales Fragoso Date: Wed, 27 Aug 2025 18:59:03 -0300 Subject: [PATCH] fix(http): Wake Payload when feeding error or eof Signed-off-by: Thales Fragoso --- actix-http/CHANGES.md | 2 ++ actix-http/src/h1/payload.rs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index 5d59f7e52..718f67922 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +- Properly wake Payload receivers when feeding errors or EOF + ## 3.11.1 - Prevent more hangs after client disconnects. diff --git a/actix-http/src/h1/payload.rs b/actix-http/src/h1/payload.rs index 726c6e935..d478c677a 100644 --- a/actix-http/src/h1/payload.rs +++ b/actix-http/src/h1/payload.rs @@ -200,11 +200,13 @@ impl Inner { #[inline] fn set_error(&mut self, err: PayloadError) { self.err = Some(err); + self.wake(); } #[inline] fn feed_eof(&mut self) { self.eof = true; + self.wake(); } #[inline] @@ -253,8 +255,7 @@ impl Inner { #[cfg(test)] mod tests { - use std::task::Poll; - use std::time::Duration; + use std::{task::Poll, time::Duration}; use actix_rt::time::timeout; use actix_utils::future::poll_fn;