diff --git a/Cargo.toml b/Cargo.toml index 149f6354c..819d2bc67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,8 +135,8 @@ actix-multipart = { path = "actix-multipart" } actix-files = { path = "actix-files" } awc = { path = "awc" } -actix-rt = { git = "https://github.com/actix/actix-net.git", branch = "feat/net_poll_ready" } -tokio = { git = "https://github.com/fakeshadow/tokio", branch = "feature/net_poll_ready" } +actix-rt = { git = "https://github.com/actix/actix-net.git" } +actix-tls = { git = "https://github.com/actix/actix-net.git" } [[bench]] name = "server" diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 7fc839bd9..22f0dc87a 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -695,14 +695,15 @@ where if timer.as_mut().poll(cx).is_ready() { // payload is pending and it's time to check the ready state of io. if this.flags.contains(Flags::PAYLOAD_PENDING) { - match Pin::new(this.io.as_mut().unwrap()).poll_read_ready(cx)? { + match Pin::new(this.io.as_mut().unwrap()).poll_write_ready(cx)? { // if io is ready and already closed resolve with dispatcher error. - Poll::Ready(ready) if ready.is_read_closed() => { - trace!("Response payload pending check determine remote connection is dropped"); - return Err(DispatchError::DisconnectTimeout); + Poll::Ready(ready) if ready.is_write_closed() => { + trace!("Response payload pending check determine remote connection is closed"); + this.flags + .insert(Flags::SHUTDOWN | Flags::WRITE_DISCONNECT); } + // otherwise reset the interval and check again after 1 second. _ => { - // reset the interval and check again after 1 second. timer .as_mut() .reset(Instant::now() + Duration::from_secs(1));