Skip to content
Open
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
11 changes: 11 additions & 0 deletions pingora-core/src/protocols/http/v1/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,12 @@ impl HttpSession {
}
HttpTask::UpgradedBody(data, end_stream) => {
self.write_non_empty_body(data, true).await?;
if !end_stream {
self.underlying_stream
.flush()
.await
.or_err(WriteError, "flushing upgraded body")?;
}
end_stream
}
HttpTask::Trailer(_) => true, // h1 trailer is not supported yet
Expand Down Expand Up @@ -1231,6 +1237,11 @@ impl HttpSession {
if end_stream {
// no-op if body wasn't initialized or is finished already
self.finish_body().await.map_err(|e| e.into_down())?;
} else if self.upgraded {
self.underlying_stream
.flush()
.await
.or_err(WriteError, "flushing upgraded body")?;
}
Ok(end_stream || self.body_writer.finished())
}
Expand Down
Loading