From b9d8a14a03af3571158889ab50795ba7f237a4e2 Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Thu, 14 Mar 2024 10:55:37 +0200 Subject: [PATCH] http2: use internal addAbortListener PR-URL: https://github.com/nodejs/node/pull/52081 Refs: https://github.com/nodejs/node/pull/48596 Reviewed-By: Moshe Atlow Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- lib/internal/http2/core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index a82691a37344f9..296968688e6802 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -46,6 +46,7 @@ assertCrypto(); const assert = require('assert'); const EventEmitter = require('events'); +const { addAbortListener } = require('internal/events/abort_listener'); const fs = require('fs'); const http = require('http'); const { readUInt16BE, readUInt32BE } = require('internal/buffer'); @@ -1832,7 +1833,7 @@ class ClientHttp2Session extends Http2Session { if (signal.aborted) { aborter(); } else { - const disposable = EventEmitter.addAbortListener(signal, aborter); + const disposable = addAbortListener(signal, aborter); stream.once('close', disposable[SymbolDispose]); } }