Unverified Commit 599eee09 authored by Anna Henningsen's avatar Anna Henningsen Committed by Michaël Zasso
Browse files

http2: do not create ArrayBuffers when no DATA received

Lazily allocate `ArrayBuffer`s for the contents of DATA frames.
Creating `ArrayBuffer`s is, sadly, not a cheap operation with V8.

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

Together with the previous commit, these changes improve throughput
in the adversarial case by about 100 %, and there is little more
that we can do besides artificially limiting the rate of incoming
metadata frames (i.e. after this patch, CPU usage is virtually
exclusively in libnghttp2).

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 c44ee7a1
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