diff options
Diffstat (limited to 'runtime/ops/http.rs')
-rw-r--r-- | runtime/ops/http.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs index 11e83f6c7..3e8a4ada7 100644 --- a/runtime/ops/http.rs +++ b/runtime/ops/http.rs @@ -502,6 +502,9 @@ async fn op_http_response_write( let mut send_data_fut = body.send_data(Vec::from(&*buf).into()).boxed_local(); poll_fn(|cx| { + let r = send_data_fut.poll_unpin(cx).map_err(AnyError::from); + + // Poll connection so the data is flushed if let Poll::Ready(Err(e)) = conn_resource.poll(cx) { // close ConnResource // close RequestResource associated with connection @@ -509,7 +512,7 @@ async fn op_http_response_write( return Poll::Ready(Err(e)); } - send_data_fut.poll_unpin(cx).map_err(AnyError::from) + r }) .await?; |