mirror of https://github.com/fafhrd91/actix-web
fix(http): Wake Payload when feeding error or eof
Signed-off-by: Thales Fragoso <thales.fragoso@axiros.com>
This commit is contained in:
parent
d9f74dc1bd
commit
edc0c1926c
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Properly wake Payload receivers when feeding errors or EOF
|
||||||
|
|
||||||
## 3.11.1
|
## 3.11.1
|
||||||
|
|
||||||
- Prevent more hangs after client disconnects.
|
- Prevent more hangs after client disconnects.
|
||||||
|
|
|
@ -200,11 +200,13 @@ impl Inner {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn set_error(&mut self, err: PayloadError) {
|
fn set_error(&mut self, err: PayloadError) {
|
||||||
self.err = Some(err);
|
self.err = Some(err);
|
||||||
|
self.wake();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn feed_eof(&mut self) {
|
fn feed_eof(&mut self) {
|
||||||
self.eof = true;
|
self.eof = true;
|
||||||
|
self.wake();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -253,8 +255,7 @@ impl Inner {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::task::Poll;
|
use std::{task::Poll, time::Duration};
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use actix_rt::time::timeout;
|
use actix_rt::time::timeout;
|
||||||
use actix_utils::future::poll_fn;
|
use actix_utils::future::poll_fn;
|
||||||
|
|
Loading…
Reference in New Issue