Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ name = "integration"
path = "tests/integration.rs"
required-features = ["full"]

[[test]]
name = "ready_stream"
path = "tests/ready_stream.rs"
required-features = ["full"]

[[test]]
name = "server"
path = "tests/server.rs"
Expand Down
17 changes: 2 additions & 15 deletions src/proto/h1/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,8 @@ where
for _ in 0..16 {
let _ = self.poll_read(cx)?;
let _ = self.poll_write(cx)?;
let conn_ready = self.poll_flush(cx)?.is_ready();
let _ = self.poll_flush(cx)?;

// If we can write more body and the connection is ready, we should
// write again. If we return `Ready(Ok(())` here, we will yield
// without a guaranteed wakeup from the write side of the connection.
// This would lead to a deadlock if we also don't expect reads.
let wants_write_again = self.can_write_again() && conn_ready;
// This could happen if reading paused before blocking on IO,
// such as getting to the end of a framed message, but then
// writing/flushing set the state back to Init. In that case,
Expand All @@ -186,10 +181,7 @@ where
//
// Using this instead of task::current() and notify() inside
// the Conn is noticeably faster in pipelined benchmarks.
let wants_read_again = self.conn.wants_read_again();
// If we cannot write or read again, we yield and rely on the
// wakeup from the connection futures.
if !(wants_write_again || wants_read_again) {
if !self.conn.wants_read_again() {
//break;
return Poll::Ready(Ok(()));
}
Expand Down Expand Up @@ -441,11 +433,6 @@ where
self.conn.close_write();
}

/// If there is pending data in body_rx, we can make progress writing if the connection is ready.
fn can_write_again(&mut self) -> bool {
self.body_rx.is_some()
}

fn is_done(&self) -> bool {
if self.is_closing {
return true;
Expand Down
234 changes: 0 additions & 234 deletions tests/ready_stream.rs

This file was deleted.