deno
d75ca4b6 - fix(ext/node): fix multiple http2 bugs (#33315)

Commit
75 days ago
fix(ext/node): fix multiple http2 bugs (#33315) ## Summary Fixes three `node:http2` bugs: - **`kSessionFrameErrorListenerCount` not defined** (#33153): The constant was used in `streamListenerAdded`/`streamListenerRemoved` but never declared, causing `undici@8.0.0` HTTP/2 requests to crash with `ReferenceError`. - **`setupConnectionsTracking` not defined** (#33067): `Http2SecureServer` referenced `setupConnectionsTracking` and `httpServerPreClose`/`HttpServer` without importing them from `node:_http_server`, causing `createSecureServer` with `allowHTTP1: true` to crash. - **`createSecureServer` gives empty response** (#33072): `streamBaseState[kLastWriteWasAsync]` is a shared global array. When `scheduleSendPending()` writes h2 frames to the underlying TLS socket, the TLS socket's write sets `kLastWriteWasAsync = 1`. This caused the h2 stream's own `afterWriteDispatched` to treat the write as async, so the write callback never fired, `_final` was never called, and the `END_STREAM` frame was never sent. Fix: reset `kLastWriteWasAsync = 0` after `scheduleSendPending()` since h2 stream writes are always synchronous. Closes #33153 Closes #33067 Closes #33072 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading