summaryrefslogtreecommitdiff
path: root/core/ops_builtin.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-09-30 07:54:12 +0200
committerGitHub <noreply@github.com>2022-09-30 07:54:12 +0200
commit20c7300412bdb487fc758577d6256bbcf96efd12 (patch)
tree2dcd218a6095a2ad143fb27e304391b5fe64cf27 /core/ops_builtin.rs
parent38f544538b337074cbce317e67859a69bb23684c (diff)
refactor(ext/http): remove op_http_read (#16096)
We can use Resource::read_return & op_read instead. This allows HTTP request bodies to participate in FastStream. To make this work, `readableStreamForRid` required a change to allow non auto-closing resources to be handled. This required some minor changes in our FastStream paths in ext/http and ext/flash.
Diffstat (limited to 'core/ops_builtin.rs')
-rw-r--r--core/ops_builtin.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs
index 02ecabc9c..6ca2a132c 100644
--- a/core/ops_builtin.rs
+++ b/core/ops_builtin.rs
@@ -165,7 +165,7 @@ async fn op_read(
buf: ZeroCopyBuf,
) -> Result<u32, Error> {
let resource = state.borrow().resource_table.get_any(rid)?;
- resource.read(buf).await.map(|n| n as u32)
+ resource.read_return(buf).await.map(|(n, _)| n as u32)
}
#[op]