diff options
author | Daniel Beckert <drbeckert@gmail.com> | 2018-12-13 20:35:48 +0300 |
---|---|---|
committer | Matheus Marchini <mat@mmarchini.me> | 2019-04-22 21:51:46 +0300 |
commit | ece507394a563bd7e3555a840a3d6980ffbb01ac (patch) | |
tree | 1d06fac01c1ca69e88107f718d12859f78a55295 /src/async_wrap.h | |
parent | 5aaf666b3b82a66485bea6a6b59fbfc838192e2f (diff) |
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 'src/async_wrap.h')
-rw-r--r-- | src/async_wrap.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/async_wrap.h b/src/async_wrap.h index d84f0c6d2f6..bcd37bb0c0d 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -46,7 +46,8 @@ namespace node { V(HTTP2STREAM) \ V(HTTP2PING) \ V(HTTP2SETTINGS) \ - V(HTTPPARSER) \ + V(HTTPINCOMINGMESSAGE) \ + V(HTTPCLIENTREQUEST) \ V(JSSTREAM) \ V(MESSAGEPORT) \ V(PIPECONNECTWRAP) \ @@ -147,11 +148,16 @@ class AsyncWrap : public BaseObject { static void DestroyAsyncIdsCallback(Environment* env, void* data); inline ProviderType provider_type() const; + inline ProviderType set_provider_type(ProviderType provider); inline double get_async_id() const; inline double get_trigger_async_id() const; + void AsyncReset(v8::Local<v8::Object> resource, + double execution_async_id = -1, + bool silent = false); + void AsyncReset(double execution_async_id = -1, bool silent = false); // Only call these within a valid HandleScope. @@ -202,7 +208,7 @@ class AsyncWrap : public BaseObject { ProviderType provider, double execution_async_id, bool silent); - const ProviderType provider_type_; + ProviderType provider_type_; // Because the values may be Reset(), cannot be made const. double async_id_ = -1; double trigger_async_id_; |