Skip to content

Commit ec9fae9

Browse files
mmomtchevBethGriggs
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 57f2fe0 commit ec9fae9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/http2/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,7 @@ function connect(authority, options, listener) {
31103110
debug('Http2Session connect', options.createConnection);
31113111
// Socket already has some buffered data - emulate receiving it
31123112
// https://github.com/nodejs/node/issues/35475
3113-
if (typeof options.createConnection === 'function') {
3113+
if (socket && socket.readableLength) {
31143114
let buf;
31153115
while ((buf = socket.read()) !== null) {
31163116
debug(`Http2Session connect: injecting ${buf.length} already in buffer`);

0 commit comments

Comments
 (0)