summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs
index e71d9fae3..af117d3f9 100644
--- a/ext/http/lib.rs
+++ b/ext/http/lib.rs
@@ -769,7 +769,11 @@ async fn op_http_write_resource(
match &mut *wr {
HttpResponseWriter::Body(body) => {
- if let Err(err) = body.write_all(&view).await {
+ let mut result = body.write_all(&view).await;
+ if result.is_ok() {
+ result = body.flush().await;
+ }
+ if let Err(err) = result {
assert_eq!(err.kind(), std::io::ErrorKind::BrokenPipe);
// Don't return "broken pipe", that's an implementation detail.
// Pull up the failure associated with the transport connection instead.