Skip to content

Commit

Permalink
http2: fix reinjection check
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mmomtchev authored and BethGriggs committed Dec 15, 2020
1 parent 57f2fe0 commit ec9fae9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3110,7 +3110,7 @@ function connect(authority, options, listener) {
debug('Http2Session connect', options.createConnection);
// Socket already has some buffered data - emulate receiving it
// https://github.com/nodejs/node/issues/35475
if (typeof options.createConnection === 'function') {
if (socket && socket.readableLength) {
let buf;
while ((buf = socket.read()) !== null) {
debug(`Http2Session connect: injecting ${buf.length} already in buffer`);
Expand Down

0 comments on commit ec9fae9

Please sign in to comment.