mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 22:28:51 +02:00
src: do not reuse async resource in http parsers
Change resource being used, previously HTTParser was being reused. We are now using IncomingMessage and ClientRequest objects. The goal here is to make the async resource unique for each async operatio Refs: https://github.com/nodejs/node/pull/24330 Refs: https://github.com/nodejs/diagnostics/issues/248 Refs: https://github.com/nodejs/node/pull/21313 Co-authored-by: Matheus Marchini <mat@mmarchini.me> PR-URL: https://github.com/nodejs/node/pull/25094 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
5aaf666b3b
commit
ece507394a
13 changed files with 102 additions and 32 deletions
|
@ -21,7 +21,7 @@ const request = Buffer.from(
|
|||
);
|
||||
|
||||
const parser = new HTTPParser(REQUEST);
|
||||
const as = hooks.activitiesOfTypes('HTTPPARSER');
|
||||
const as = hooks.activitiesOfTypes('HTTPINCOMINGMESSAGE');
|
||||
const httpparser = as[0];
|
||||
|
||||
assert.strictEqual(as.length, 1);
|
||||
|
@ -47,7 +47,7 @@ process.on('exit', onexit);
|
|||
|
||||
function onexit() {
|
||||
hooks.disable();
|
||||
hooks.sanityCheck('HTTPPARSER');
|
||||
hooks.sanityCheck('HTTPINCOMINGMESSAGE');
|
||||
checkInvocations(httpparser, { init: 1, before: 1, after: 1, destroy: 1 },
|
||||
'when process exits');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue