Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 28a6e59

Browse filesBrowse files
BridgeARBethGriggs
authored andcommitted
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. Backport-PR-URL: #22850 PR-URL: #20311 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 41dca9e commit 28a6e59
Copy full SHA for 28a6e59

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/http2/core.js‎

Copy file name to clipboardExpand all lines: lib/internal/http2/core.js
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,11 @@ const proxySocketHandler = {
662662
// data received on the PING acknowlegement.
663663
function pingCallback(cb) {
664664
return function pingCallback(ack, duration, payload) {
665-
const err = ack ? null : new errors.Error('ERR_HTTP2_PING_CANCEL');
666-
cb(err, duration, payload);
665+
if (ack) {
666+
cb(null, duration, payload);
667+
} else {
668+
cb(new errors.Error('ERR_HTTP2_PING_CANCEL'));
669+
}
667670
};
668671
}
669672

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.