summaryrefslogtreecommitdiff
path: root/ext/http/http_next.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-07-19 03:04:26 +0530
committerGitHub <noreply@github.com>2023-07-18 23:34:26 +0200
commit51b3534b3d3833667e8c029564bebf319b0d2596 (patch)
tree5126ecf7ea971651003173e33b104d99e38d2172 /ext/http/http_next.rs
parent7e1218cd8f9856319e2c86e761e869ef48bf9c5f (diff)
fix(ext/node): check if resource can be used with write_vectored (#19868)
Fixes https://github.com/denoland/deno/issues/19766 Fixes https://github.com/denoland/deno/issues/19846
Diffstat (limited to 'ext/http/http_next.rs')
-rw-r--r--ext/http/http_next.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs
index 019054894..e95839005 100644
--- a/ext/http/http_next.rs
+++ b/ext/http/http_next.rs
@@ -1078,6 +1078,11 @@ impl Resource for UpgradeStream {
}
}
+#[op(fast)]
+pub fn op_can_write_vectored(state: &mut OpState, rid: ResourceId) -> bool {
+ state.resource_table.get::<UpgradeStream>(rid).is_ok()
+}
+
#[op]
pub async fn op_raw_write_vectored(
state: Rc<RefCell<OpState>>,