Skip to content

Commit edc0c19

Browse files
committed
fix(http): Wake Payload when feeding error or eof
Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>
1 parent d9f74dc commit edc0c19

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

actix-http/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Properly wake Payload receivers when feeding errors or EOF
6+
57
## 3.11.1
68

79
- Prevent more hangs after client disconnects.

actix-http/src/h1/payload.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,13 @@ impl Inner {
200200
#[inline]
201201
fn set_error(&mut self, err: PayloadError) {
202202
self.err = Some(err);
203+
self.wake();
203204
}
204205

205206
#[inline]
206207
fn feed_eof(&mut self) {
207208
self.eof = true;
209+
self.wake();
208210
}
209211

210212
#[inline]
@@ -253,8 +255,7 @@ impl Inner {
253255

254256
#[cfg(test)]
255257
mod tests {
256-
use std::task::Poll;
257-
use std::time::Duration;
258+
use std::{task::Poll, time::Duration};
258259

259260
use actix_rt::time::timeout;
260261
use actix_utils::future::poll_fn;

0 commit comments

Comments
 (0)