summaryrefslogtreecommitdiff
path: root/ext/http/response_body.rs
diff options
context:
space:
mode:
authorLaurence Rowe <l@lrowe.co.uk>2023-11-13 06:04:49 -0800
committerGitHub <noreply@github.com>2023-11-13 07:04:49 -0700
commit542314a0becbba120dbee13b3f410f647b4c9cb7 (patch)
treed552d924bb68e0d5ae245cf9b65f87187cce4555 /ext/http/response_body.rs
parent1ef617e8f3d48098e69e222b6eb6fe981aeca1c3 (diff)
refactor(ext/http): refer to HttpRecord directly using v8::External (#20770)
Makes the JavaScript Request use a v8:External opaque pointer to directly refer to the Rust HttpRecord. The HttpRecord is now reference counted. To avoid leaks the strong count is checked at request completion. Performance seems unchanged on the minimal benchmark. 118614 req/s this branch vs 118564 req/s on main, but variance between runs on my laptop is pretty high. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'ext/http/response_body.rs')
-rw-r--r--ext/http/response_body.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/http/response_body.rs b/ext/http/response_body.rs
index 4f7e3b0a5..7d91dce6b 100644
--- a/ext/http/response_body.rs
+++ b/ext/http/response_body.rs
@@ -23,7 +23,7 @@ use hyper1::body::Frame;
use hyper1::body::SizeHint;
use pin_project::pin_project;
-use crate::slab::HttpRequestBodyAutocloser;
+use crate::service::HttpRequestBodyAutocloser;
/// Simplification for nested types we use for our streams. We provide a way to convert from
/// this type into Hyper's body [`Frame`].
@@ -80,6 +80,7 @@ impl CompletionHandle {
}
}
+ #[allow(dead_code)]
pub fn is_completed(&self) -> bool {
self.inner.borrow().complete
}