summaryrefslogtreecommitdiff
path: root/ext/http/http_next.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-11-18 13:16:53 -0700
committerGitHub <noreply@github.com>2023-11-18 13:16:53 -0700
commit679b7bb8fafc1464d5eb1c48989d477157be2330 (patch)
tree8a1edac7cacf715ab9bc0499bf3a1e2b65cf66e9 /ext/http/http_next.rs
parentc213ad380f349dee1f65e6d9a9f7a8fa669b2af2 (diff)
fix(ext/http): fix crash in dropped Deno.serve requests (#21252)
Fixes #21250 We were attempting to recycle dropped resource responses too early.
Diffstat (limited to 'ext/http/http_next.rs')
-rw-r--r--ext/http/http_next.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs
index 98fbd1f8b..9504a6fa4 100644
--- a/ext/http/http_next.rs
+++ b/ext/http/http_next.rs
@@ -716,6 +716,8 @@ pub async fn op_http_set_response_body_resource(
}
};
+ *http.needs_close_after_finish() = true;
+
set_response(
http.clone(),
resource.size_hint().1.map(|s| s as usize),
@@ -726,7 +728,6 @@ pub async fn op_http_set_response_body_resource(
},
);
- *http.needs_close_after_finish() = true;
http.response_body_finished().await;
Ok(())
}