Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
http2: fix reinjection check
We reinject when the sockets has already waiting
data, remarked by @mildsunrise

Co-authored-by: Alba Mendez <me@alba.sh>
  • Loading branch information
mmomtchev and mildsunrise authored Oct 18, 2020
commit e36b31c1bc4292085e10d2f019a1a046076cfc2c
2 changes: 1 addition & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3132,7 +3132,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