diff options
Diffstat (limited to 'ext/fetch/26_fetch.js')
-rw-r--r-- | ext/fetch/26_fetch.js | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index 22baaf5c2..f15e7f6b9 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -73,24 +73,6 @@ return core.opAsync("op_fetch_send", rid); } - /** - * @param {number} rid - * @param {Uint8Array} body - * @returns {Promise<void>} - */ - function opFetchRequestWrite(rid, body) { - return core.opAsync("op_fetch_request_write", rid, body); - } - - /** - * @param {number} rid - * @param {Uint8Array} body - * @returns {Promise<number>} - */ - function opFetchResponseRead(rid, body) { - return core.opAsync("op_fetch_response_read", rid, body); - } - // A finalization registry to clean up underlying fetch resources that are GC'ed. const RESOURCE_REGISTRY = new FinalizationRegistry((rid) => { core.tryClose(rid); @@ -120,7 +102,8 @@ // This is the largest possible size for a single packet on a TLS // stream. const chunk = new Uint8Array(16 * 1024 + 256); - const read = await opFetchResponseRead( + // TODO(@AaronO): switch to handle nulls if that's moved to core + const read = await core.read( responseBodyRid, chunk, ); @@ -260,7 +243,7 @@ } try { await PromisePrototypeCatch( - opFetchRequestWrite(requestBodyRid, value), + core.write(requestBodyRid, value), (err) => { if (terminator.aborted) return; throw err; |