deno
b905fce2 - fix(ext/node): buffer http2 client body until 'response' emitted

Commit
13 days ago
fix(ext/node): buffer http2 client body until 'response' emitted The first approach gated readStart in _read, but Deno delivers DATA frames via onStreamRead -> push() independently of readStart, so body 'data' still raced ahead of the process.nextTick-deferred 'response'. Instead buffer everything pushed on a ClientHttp2Stream (body chunks and the trailing null EOF) until the 'response'/'push' event is emitted, then flush the queue in order from emitClientResponseNT. This guarantees Node's event ordering ('response' before 'data').
Author
Parents
Loading