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: nodejs#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 nodejs-github-bot committed Oct 25, 2020
1 parent 75202d9 commit 1f703e1
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 @@ -3144,7 +3144,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 1f703e1

Please sign in to comment.