mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
5542a98aa4
commit
7d9f1f3971
1 file changed
+5
-2
@@ -704,8 +704,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());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user