Skip to content

Commit

Permalink
Revert "Prevent busy loop"
Browse files Browse the repository at this point in the history
This reverts commit 5d314b6.
  • Loading branch information
mxinden committed Apr 5, 2024
1 parent 158fc73 commit 3beb0c5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions neqo-http3/src/send_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ impl SendMessage {
fn get_stream_info(&self) -> Http3StreamInfo {
Http3StreamInfo::new(self.stream_id(), Http3StreamType::Http)
}

fn stream_avail_send_space(&self, conn: &Connection) -> Res<usize> {
conn.stream_avail_send_space(self.stream_id())
.map_err(|e| Error::map_stream_send_errors(&e.into()))
}
}

impl Stream for SendMessage {
Expand All @@ -179,7 +174,9 @@ impl SendStream for SendMessage {
if self.stream.has_buffered_data() {
return Ok(0);
}
let available = self.stream_avail_send_space(conn)?;
let available = conn
.stream_avail_send_space(self.stream_id())
.map_err(|e| Error::map_stream_send_errors(&e.into()))?;
if available <= 2 {
return Ok(0);
}
Expand Down Expand Up @@ -256,8 +253,7 @@ impl SendStream for SendMessage {
Error::HttpInternal(6),
)?;
qtrace!([self], "done sending request");
} else if self.stream_avail_send_space(conn)? > 2 {
// TODO: Deduplicate and document 2
} else {
// DataWritable is just a signal for an application to try to write more data,
// if writing fails it is fine. Therefore we do not need to properly check
// whether more credits are available on the transport layer.
Expand Down

0 comments on commit 3beb0c5

Please sign in to comment.