diff options
author | James Ide <ide@expo.io> | 2018-07-20 17:25:02 -0700 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-07-31 09:35:46 +0200 |
commit | 337b2df82fc394499c7704be8ead3ff14a924d2f (patch) | |
tree | e72577ef3e819f38d76bae508b00ebe6479309a6 /deps/npm/man/man1/npm-ci.1 | |
parent | 98d461e8ccf1e70b44a0ade0b4c41af2ab6b88fc (diff) | |
download | node-new-337b2df82fc394499c7704be8ead3ff14a924d2f.tar.gz |
http2: release request()'s "connect" event listener after it runs
The `Http2Session#request()` method internally listens to the "connect"
event if the session has not yet established a connection so that the
actual request can be sent after the connection has been established.
This commit removes the event listener after it runs and carries out
the request and is no longer needed. In practice this shouldn't affect
the behavior of the session object since the "connect" event fires only
once anyway, but removing the listener releases its references. The
rest of this class subscribes to the "connect" event with `once`
instead of `on` as well.
Tested by adding a new test that ensures `Http2Session#request()` is
called before the connection is established, indicated by a "connect"
listener that is run. The test also ensures all "connect" listeners are
removed after the connection is established.
PR-URL: https://github.com/nodejs/node/pull/21916
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/npm/man/man1/npm-ci.1')
0 files changed, 0 insertions, 0 deletions