From d0230299a9c4e7f1f2d7c2cf888f0f024c2eaa1e Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Tue, 3 Jun 2025 14:16:52 -0700 Subject: [PATCH] partial --- src/js/node/http2.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/node/http2.ts b/src/js/node/http2.ts index 14797f6bb3..b798cf3755 100644 --- a/src/js/node/http2.ts +++ b/src/js/node/http2.ts @@ -2731,7 +2731,6 @@ class ServerHttp2Session extends Http2Session { } #onClose() { - console.log("onClose ServerHttp2Session"); const parser = this.#parser; if (parser) { parser.emitAbortToAllStreams(); @@ -3275,14 +3274,18 @@ class ClientHttp2Session extends Http2Session { } #onClose() { - console.log("onClose ClientHttp2Session"); const parser = this.#parser; + const err = this.connecting ? $ERR_SOCKET_CLOSED() : null; if (parser) { - parser.emitAbortToAllStreams(); + for (const stream of parser.getAllStreams()) { + if (stream) { + stream.close(NGHTTP2_CANCEL); + } + } parser.detach(); this.#parser = null; } - this.close(); + this.destroy(err, NGHTTP2_NO_ERROR); this[bunHTTP2Socket] = null; } #onError(error: Error) {