summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2018-05-16 22:15:20 +0200
committerAnatoli Papirovski <apapirovski@mac.com>2018-05-22 12:10:22 +0400
commit4a940aadfabc35be404da64e9ab7014a8cc71728 (patch)
treebe08259aa783d3d3f496ec18eaddea10ca3db417 /lib
parentef9d0ae6f209851dd43d7d24b12e19547bcf0dbf (diff)
downloadandroid-node-v8-4a940aadfabc35be404da64e9ab7014a8cc71728.tar.gz
android-node-v8-4a940aadfabc35be404da64e9ab7014a8cc71728.tar.bz2
android-node-v8-4a940aadfabc35be404da64e9ab7014a8cc71728.zip
http: do not rely on the 'agentRemove' event
Do not use the `'agentRemove'` event to null `socket._httpMessage` as that event is public and can be used to not keep a request in the agent. PR-URL: https://github.com/nodejs/node/pull/20786 Fixes: https://github.com/nodejs/node/issues/20690 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_http_agent.js1
-rw-r--r--lib/_http_client.js1
2 files changed, 1 insertions, 1 deletions
diff --git a/lib/_http_agent.js b/lib/_http_agent.js
index 303f56bfe4..67f3d667b2 100644
--- a/lib/_http_agent.js
+++ b/lib/_http_agent.js
@@ -276,7 +276,6 @@ function installListeners(agent, s, options) {
s.removeListener('close', onClose);
s.removeListener('free', onFree);
s.removeListener('agentRemove', onRemove);
- s._httpMessage = null;
}
s.on('agentRemove', onRemove);
}
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 4b21cee745..4542a81cf0 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -467,6 +467,7 @@ function socketOnData(d) {
socket.removeListener('close', socketCloseListener);
socket.removeListener('error', socketErrorListener);
+ socket._httpMessage = null;
socket.readableFlowing = null;
req.emit(eventName, res, socket, bodyHead);