http: cache parser callbacks · nodejs/node@f8d3011 · GitHub
Skip to content

Commit f8d3011

Browse files
mcollinaaduh95
authored andcommitted
http: cache parser callbacks
Cache the per-message callback lookups on the parser's JS object instead of retaining callback functions in strong v8::Global handles. A callback that captures its parser can otherwise keep the parser alive. Clear the cache when a parser is initialized or freed so reused parsers can load replacement callbacks and idle parsers do not retain them. Header field names remain non-internalized because they are supplied by clients. Assisted-by: pi Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #66152 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent e3f861b commit f8d3011

2 files changed

Lines changed: 98 additions & 7 deletions

File tree

‎src/node_http_parser.cc‎

Lines changed: 37 additions & 7 deletions
Lines changed: 61 additions & 0 deletions

0 commit comments

Comments
 (0)