Skip to content

Commit 39548ce

Browse files
authored
drop write end of stream before writing trailers (#130)
This tells the receiver that there is no body content remaining and that it should switch to reading the trailers, if any. Otherwise, the sender and receiver will deadlock, with the sender waiting to rendezvous its write to the trailers future and the receiver waiting to receive more content bytes. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent e022abb commit 39548ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/wasip3/src/http_compat/body_writer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ impl BodyWriter {
9999
None => break,
100100
}
101101
}
102+
drop(self.stream_writer);
102103
let maybe_trailers = if self.trailers.is_empty() {
103104
None
104105
} else {

0 commit comments

Comments
 (0)