Skip to content

Commit ec9fae9

Browse files
mmomtchevBethGriggs
authored andcommittedDec 15, 2020
http2: fix reinjection check
We reinject when the sockets has already waiting data, remarked by @mildsunrise Co-authored-by: Alba Mendez <me@alba.sh> PR-URL: #35678 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Alba Mendez <me@alba.sh> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
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

+1-1
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)
Please sign in to comment.