Skip to content

Commit 86f27e2

Browse files
manNomiaduh95
authored andcommitted
quic: preserve session stats after close
Signed-off-by: manNomi <hanmw110@naver.com> PR-URL: #64489 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d2956fe commit 86f27e2

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

lib/internal/quic/stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ class QuicSessionStats {
870870
[kFinishClose]() {
871871
const view = TypedArrayPrototypeSubarray(this.#handle,
872872
this.#offset,
873-
this.#offset + IDX_STATS_STREAM_COUNT);
873+
this.#offset + IDX_STATS_SESSION_COUNT);
874874
this.#handle = new BigUint64Array(view);
875875
this.#offset = 0;
876876
this.#disconnected = true;

test/parallel/test-quic-session-stream-lifecycle.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ clientSession.destroy();
9090
strictEqual(clientSession.destroyed, true);
9191
strictEqual(clientSession.endpoint, null);
9292
strictEqual(clientSession.stats.isConnected, false);
93+
strictEqual(typeof clientSession.stats.cwnd, 'bigint');
94+
strictEqual(typeof clientSession.stats.streamsIdleTimedOut, 'bigint');
9395

9496
strictEqual(stream.destroyed, true);
9597

0 commit comments

Comments
 (0)