From 1f813cc4fd89552d16f60c9a15ea970b30191a38 Mon Sep 17 00:00:00 2001 From: Lovingly <42682205+lovinglyy@users.noreply.github.com> Date: Sat, 15 Sep 2018 03:49:06 -0300 Subject: [PATCH 1/2] http2: do not emit 'aborted' if the stream closed --- lib/internal/http2/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index f2a298b6e5df69..42877455454658 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -1489,7 +1489,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) { if (!ending) { // If the writable side of the Http2Stream is still open, emit the // 'aborted' event and set the aborted flag. - if (!stream.aborted) { + if (!stream.aborted && !stream.closed) { state.flags |= STREAM_FLAGS_ABORTED; stream.emit('aborted'); } From b2596fc638b343101d2f2a7120fd033e4b56a3cf Mon Sep 17 00:00:00 2001 From: Lovingly <42682205+lovinglyy@users.noreply.github.com> Date: Sat, 15 Sep 2018 15:12:24 -0300 Subject: [PATCH 2/2] http2: aborted check if the stream closed locally --- lib/internal/http2/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 42877455454658..518ffca5553ed4 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -1489,7 +1489,7 @@ function closeStream(stream, code, rstStreamStatus = kSubmitRstStream) { if (!ending) { // If the writable side of the Http2Stream is still open, emit the // 'aborted' event and set the aborted flag. - if (!stream.aborted && !stream.closed) { + if (!stream.aborted && !stream.state.localClose) { state.flags |= STREAM_FLAGS_ABORTED; stream.emit('aborted'); }