Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 59 additions & 126 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,10 @@ hickory-server = "0.25.2"
http = "1.0"
http-body = "1.0"
http-body-util = "0.1.2"
http_v02 = { package = "http", version = "0.2.9" }
httparse = "1.8.0"
hyper = { version = "1.6.0", features = ["full"] }
hyper-rustls = { version = "0.27.2", default-features = false, features = ["http1", "http2", "tls12", "aws-lc-rs"] }
hyper-util = { version = "0.1.10", features = ["tokio", "client", "client-legacy", "server", "server-auto"] }
hyper_v014 = { package = "hyper", version = "0.14.26", features = ["runtime", "http1"] }
idna = "1.0.3"
ignore = "0.4"
import_map = { version = "0.23.0", features = ["ext"] }
Expand Down
10 changes: 7 additions & 3 deletions ext/http/00_serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,12 @@ function fastSyncResponseOrStream(
rid = resourceForReadableStream(stream);
autoClose = true;
}
PromisePrototypeThen(
return PromisePrototypeThen(
op_http_set_response_body_resource(req, rid, autoClose, status),
(success) => {
innerRequest?.close(success);
op_http_close_after_finish(req);
return success;
},
);
}
Expand Down Expand Up @@ -997,7 +998,7 @@ function serveHttpOn(context, addr, callback) {
let req;
try {
// Attempt to pull as many requests out of the queue as possible before awaiting. This API is
// a synchronous, non-blocking API that returns u32::MAX if anything goes wrong.
// a synchronous, non-blocking API that returns null if anything goes wrong.
while ((req = op_http_try_wait(rid)) !== null) {
PromisePrototypeCatch(callback(req, undefined), promiseErrorHandler);
}
Expand All @@ -1024,7 +1025,7 @@ function serveHttpOn(context, addr, callback) {

try {
if (!context.closing && !context.closed) {
context.closing = await op_http_close(rid, false);
context.closing = op_http_close(rid, false);
context.close();
}

Expand Down Expand Up @@ -1163,6 +1164,9 @@ function registerDeclarativeServer(exports) {

export {
addTrailers,
CallbackContext,
fastSyncResponseOrStream,
InnerRequest,
registerDeclarativeServer,
serve,
serveHttpOnConnection,
Expand Down
Loading