diff options
author | Daniel Beckert <drbeckert@gmail.com> | 2018-12-13 15:35:48 -0200 |
---|---|---|
committer | Matheus Marchini <mat@mmarchini.me> | 2019-04-22 11:51:46 -0700 |
commit | ece507394a563bd7e3555a840a3d6980ffbb01ac (patch) | |
tree | 1d06fac01c1ca69e88107f718d12859f78a55295 /test/sequential | |
parent | 5aaf666b3b82a66485bea6a6b59fbfc838192e2f (diff) | |
download | android-node-v8-ece507394a563bd7e3555a840a3d6980ffbb01ac.tar.gz android-node-v8-ece507394a563bd7e3555a840a3d6980ffbb01ac.tar.bz2 android-node-v8-ece507394a563bd7e3555a840a3d6980ffbb01ac.zip |
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>
Diffstat (limited to 'test/sequential')
-rw-r--r-- | test/sequential/test-async-wrap-getasyncid.js | 2 | ||||
-rw-r--r-- | test/sequential/test-http-regr-gh-2928.js | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 0818dec2db..e3cfd6bef0 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -48,6 +48,8 @@ const { getSystemErrorName } = require('util'); if (!common.isMainThread) delete providers.INSPECTORJSBINDING; delete providers.KEYPAIRGENREQUEST; + delete providers.HTTPCLIENTREQUEST; + delete providers.HTTPINCOMINGMESSAGE; const objKeys = Object.keys(providers); if (objKeys.length > 0) diff --git a/test/sequential/test-http-regr-gh-2928.js b/test/sequential/test-http-regr-gh-2928.js index 91db08df47..400dc02013 100644 --- a/test/sequential/test-http-regr-gh-2928.js +++ b/test/sequential/test-http-regr-gh-2928.js @@ -7,6 +7,7 @@ const common = require('../common'); const assert = require('assert'); const httpCommon = require('_http_common'); const { HTTPParser } = require('_http_common'); +const { AsyncResource } = require('async_hooks'); const net = require('net'); const COUNT = httpCommon.parsers.max + 1; @@ -24,7 +25,7 @@ function execAndClose() { process.stdout.write('.'); const parser = parsers.pop(); - parser.reinitialize(HTTPParser.RESPONSE, !!parser.reused); + parser.initialize(HTTPParser.RESPONSE, new AsyncResource('ClientRequest')); const socket = net.connect(common.PORT); socket.on('error', (e) => { |