-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: defines all the fields in the constructor #9116
Conversation
@@ -197,7 +197,9 @@ function ClientRequest(options, cb) { | |||
self = null; | |||
}); | |||
|
|||
this._ended = false; | |||
self._ended = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't affect anything, but I found two different ways across the single constructor: self
and this
. Seems it should be consistent but I don't know the agreement about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis didn't you mention in another issue recently that we should prefer this
and an arrow function over self
?
this._ended = false; | ||
self._ended = false; | ||
self.res = null; | ||
self.aborted = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're setting this to zero now, we should both remove ClientRequest.prototype.aborted = undefined;
and change the if (this.aborted === undefined)
check to if (!this.aborted)
below.
@@ -197,7 +197,9 @@ function ClientRequest(options, cb) { | |||
self = null; | |||
}); | |||
|
|||
this._ended = false; | |||
self._ended = false; | |||
self.res = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should also change delete req.res
later in this file to req.res = null
?
@mscdex made some fixes after review:
Also, started to use |
Guys, why do windows tests fail? Seems it's not the result of this changes, considering it's about JavaScript code, isn't it? |
@vitkarpov In this case, the Windows failure is the result of a CI infrastructure issue and is unrelated to this PR. I'm not sure why aix failed though, it seems it couldn't find the built node binary for some reason. /cc @mhdawson ? The ARM failure looks unrelated. |
Yep, I've noticed that some other prs behave the same. |
c133999
to
83c7a88
Compare
Guys, what's gonna happen with this pr? I'm ready to rebase the branch when it will be about to be merged, but I'm not sure about the process (there's not milestone tag or something). |
Minimally, this needs a rebase, collaborator approval, and a new CI run. |
@cjihrig rebased |
@vitkarpov
var called = false;
if (self.socketPath) {
// ...
this.timeoutCb = null;
this.upgradeOrConnect = false; |
@mscdex Done. |
CI is green, except for an unrelated CI infrastructure failure. LGTM. /cc @nodejs/collaborators |
I think there are additional properties to add:
|
As this has not been backported I'm setting to |
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: nodejs#9116
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In Refs, http.Server's maxHeadersCount field was defined in the constructor to make hidden class stable and so on. Also in https.Server, we can use maxHeadersCount the same as http via connectionListener. So, defines it in the constructor and documentation. Refs: #9116 PR-URL: #20359 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesDescription of change
res and abort fields are now defined in the constructor and not suddenly appear during the runtime. This makes hidden class stable and the heap snapshot more verbose.
Ref: #8912
PR-URL: #9116