Unverified Commit dd60d356 authored by Anna Henningsen's avatar Anna Henningsen Committed by Beth Griggs
Browse files

http2: only call into JS when necessary for session events

For some JS events, it only makes sense to call into JS when there
are listeners for the event in question.

The overhead is noticeable if a lot of these events are emitted during
the lifetime of a session. To reduce this overhead, keep track of
whether any/how many JS listeners are present, and if there are none,
skip calls into JS altogether.

This is part of performance improvements to mitigate CVE-2019-9513.

Backport-PR-URL: https://github.com/nodejs/node/pull/29124
PR-URL: https://github.com/nodejs/node/pull/29122


Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 00f6846b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment