Skip to content

Commit 7d9f1f3

Browse files
BridgeARMylesBorins
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. 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 5542a98 commit 7d9f1f3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎lib/internal/http2/core.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,11 @@ const proxySocketHandler = {
704704
// data received on the PING acknowlegement.
705705
functionpingCallback(cb){
706706
returnfunctionpingCallback(ack,duration,payload){
707-
consterr=ack ? null : newERR_HTTP2_PING_CANCEL();
708-
cb(err,duration,payload);
707+
if(ack){
708+
cb(null,duration,payload);
709+
}else{
710+
cb(newERR_HTTP2_PING_CANCEL());
711+
}
709712
};
710713
}
711714

0 commit comments

Comments
 (0)