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
Next Next commit
http2: fix ping callback
In case there was no ack, the callback would have returned
more than the error as return value. This makes sure that is not
the case anymore.
  • Loading branch information
BridgeAR committed Apr 26, 2018
commit 81fabe26bb04f12e2acd4da37b2c3b9bc9a69b6d
7 changes: 5 additions & 2 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,11 @@ const proxySocketHandler = {
// data received on the PING acknowlegement.
function pingCallback(cb) {
return function pingCallback(ack, duration, payload) {
const err = ack ? null : new ERR_HTTP2_PING_CANCEL();
cb(err, duration, payload);
if (ack) {
cb(null, duration, payload);
} else {
cb(new ERR_HTTP2_PING_CANCEL());
}
};
}

Expand Down