Skip to content

Commit 86ed87b

Browse files
mmomtchevtargos
authored andcommitted
http2: fix reinjection check
We reinject when the sockets has already waiting data, remarked by @mildsunrise Co-authored-by: Alba Mendez <[email protected]> PR-URL: #35678 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Alba Mendez <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Ricky Zhou <[email protected]>
1 parent 5833007 commit 86ed87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/http2/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3144,7 +3144,7 @@ function connect(authority, options, listener) {
31443144
debug('Http2Session connect', options.createConnection);
31453145
// Socket already has some buffered data - emulate receiving it
31463146
// https://github.com/nodejs/node/issues/35475
3147-
if (typeof options.createConnection === 'function') {
3147+
if (socket && socket.readableLength) {
31483148
let buf;
31493149
while ((buf = socket.read()) !== null) {
31503150
debug(`Http2Session connect: injecting ${buf.length} already in buffer`);

0 commit comments

Comments
 (0)