1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 10:42:55 +01:00

ensure poll_flush on h1 connection disconnect (#1974)

This commit is contained in:
fakeshadow 2021-02-10 02:11:53 -08:00 committed by GitHub
parent 949d14ae2b
commit dcad9724bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -841,9 +841,8 @@ where
if inner.flags.contains(Flags::WRITE_DISCONNECT) { if inner.flags.contains(Flags::WRITE_DISCONNECT) {
Poll::Ready(Ok(())) Poll::Ready(Ok(()))
} else { } else {
// flush buffer // flush buffer and wait on block.
inner.as_mut().poll_flush(cx)?; if inner.as_mut().poll_flush(cx)? {
if !inner.write_buf.is_empty() {
Poll::Pending Poll::Pending
} else { } else {
Pin::new(inner.project().io.as_mut().unwrap()) Pin::new(inner.project().io.as_mut().unwrap())