summaryrefslogtreecommitdiff
path: root/runtime/js/40_http.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-12 21:55:05 +0200
committerGitHub <noreply@github.com>2021-04-12 15:55:05 -0400
commit46b1c653c0c433932908b7610f60b409af134c76 (patch)
tree00d8b59c8c4e9b90538d548ebd828d2b3f94d4fd /runtime/js/40_http.js
parenta20504642d083172f297543f9788b128e9c2e0bc (diff)
refactor(deno): remove concept of bin & json ops (#10145)
Diffstat (limited to 'runtime/js/40_http.js')
-rw-r--r--runtime/js/40_http.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js
index d9dff7b52..4a2dcdf4a 100644
--- a/runtime/js/40_http.js
+++ b/runtime/js/40_http.js
@@ -10,7 +10,7 @@
const { ReadableStream } = window.__bootstrap.streams;
function serveHttp(conn) {
- const rid = Deno.core.jsonOpSync("op_http_start", conn.rid);
+ const rid = Deno.core.opSync("op_http_start", conn.rid);
return new HttpConn(rid);
}
@@ -30,7 +30,7 @@
async nextRequest() {
let nextRequest;
try {
- nextRequest = await Deno.core.jsonOpAsync(
+ nextRequest = await Deno.core.opAsync(
"op_http_request_next",
this.#rid,
);
@@ -88,7 +88,7 @@
}
function readRequest(requestRid, zeroCopyBuf) {
- return Deno.core.jsonOpAsync(
+ return Deno.core.opAsync(
"op_http_request_read",
requestRid,
zeroCopyBuf,
@@ -129,7 +129,7 @@
zeroCopyBuf = null;
}
- const responseBodyRid = Deno.core.jsonOpSync("op_http_response", [
+ const responseBodyRid = Deno.core.opSync("op_http_response", [
responseSenderRid,
resp.status ?? 200,
flattenHeaders(resp.headers),
@@ -149,7 +149,7 @@
chunk.byteOffset,
chunk.byteLength,
);
- await Deno.core.jsonOpAsync(
+ await Deno.core.opAsync(
"op_http_response_write",
responseBodyRid,
data,
@@ -158,7 +158,7 @@
// Once all chunks are sent, and the request body is closed, we can close
// the response body.
- await Deno.core.jsonOpAsync("op_http_response_close", responseBodyRid);
+ await Deno.core.opAsync("op_http_response_close", responseBodyRid);
}
};
}