Skip to content

Commit

Permalink
http2: use addAbortListener
Browse files Browse the repository at this point in the history
PR-URL: #48550
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
atlowChemi authored and juanarbol committed Jul 13, 2023
1 parent cc7809d commit e4333ac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const {
StringPrototypeSlice,
Symbol,
SymbolAsyncDispose,
SymbolDispose,
TypedArrayPrototypeGetLength,
Uint32Array,
Uint8Array,
Expand Down Expand Up @@ -1811,10 +1812,8 @@ class ClientHttp2Session extends Http2Session {
if (signal.aborted) {
aborter();
} else {
signal.addEventListener('abort', aborter);
stream.once('close', () => {
signal.removeEventListener('abort', aborter);
});
const disposable = EventEmitter.addAbortListener(signal, aborter);
stream.once('close', disposable[SymbolDispose]);
}
}

Expand Down

0 comments on commit e4333ac

Please sign in to comment.