summaryrefslogtreecommitdiff
path: root/lib/_http_client.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2018-04-26 09:53:54 +0200
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-05-14 23:05:09 +0300
commit4b00c4fafaa2ae8c41c1f78823c0feb810ae4723 (patch)
treee169a5ced04f231f4a11c02d4602a2cb426200a3 /lib/_http_client.js
parent50b334befd494546faca720e541ea88f7553731c (diff)
downloadandroid-node-v8-4b00c4fafaa2ae8c41c1f78823c0feb810ae4723.tar.gz
android-node-v8-4b00c4fafaa2ae8c41c1f78823c0feb810ae4723.tar.bz2
android-node-v8-4b00c4fafaa2ae8c41c1f78823c0feb810ae4723.zip
http: make client `.aborted` boolean
PR-URL: https://github.com/nodejs/node/pull/20230 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/_http_client.js')
-rw-r--r--lib/_http_client.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 92c2954d0c..4b21cee745 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -165,7 +165,7 @@ function ClientRequest(options, cb) {
this._ended = false;
this.res = null;
- this.aborted = undefined;
+ this.aborted = false;
this.timeoutCb = null;
this.upgradeOrConnect = false;
this.parser = null;
@@ -291,11 +291,7 @@ ClientRequest.prototype.abort = function abort() {
if (!this.aborted) {
process.nextTick(emitAbortNT.bind(this));
}
-
- // Mark as aborting so we can avoid sending queued request data
- // This is used as a truthy flag elsewhere. The use of Date.now is for
- // debugging purposes only.
- this.aborted = Date.now();
+ this.aborted = true;
// If we're aborting, we don't care about any more response data.
if (this.res) {