Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ba2cf9

Browse filesBrowse files
vitkarpovItalo A. Casas
authored andcommitted
http: define all used properties in constructors
Adding all used properties in the constructor makes the hidden class stable and heap snapshots more verbose. Refs: #8912 PR-URL: #9116 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 4323c80 commit 8ba2cf9
Copy full SHA for 8ba2cf9

File tree

Expand file treeCollapse file tree

2 files changed

+11
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-6
lines changed
Open diff view settings
Collapse file

‎lib/_http_client.js‎

Copy file name to clipboardExpand all lines: lib/_http_client.js
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ function ClientRequest(options, cb) {
172172
self._renderHeaders());
173173
}
174174

175+
this._ended = false;
176+
this.res = null;
177+
this.aborted = undefined;
178+
this.timeoutCb = null;
179+
this.upgradeOrConnect = false;
180+
this.parser = null;
181+
this.maxHeadersCount = null;
182+
175183
var called = false;
176184
if (self.socketPath) {
177185
self._last = true;
@@ -239,16 +247,12 @@ function ClientRequest(options, cb) {
239247
self._flush();
240248
self = null;
241249
});
242-
243-
this._ended = false;
244250
}
245251

246252
util.inherits(ClientRequest, OutgoingMessage);
247253

248254
exports.ClientRequest = ClientRequest;
249255

250-
ClientRequest.prototype.aborted = undefined;
251-
252256
ClientRequest.prototype._finish = function _finish() {
253257
DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
254258
LTTNG_HTTP_CLIENT_REQUEST(this, this.connection);
@@ -262,7 +266,7 @@ ClientRequest.prototype._implicitHeader = function _implicitHeader() {
262266
};
263267

264268
ClientRequest.prototype.abort = function abort() {
265-
if (this.aborted === undefined) {
269+
if (!this.aborted) {
266270
process.nextTick(emitAbortNT, this);
267271
}
268272
// Mark as aborting so we can avoid sending queued request data
@@ -491,7 +495,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
491495

492496
if (res.statusCode === 100) {
493497
// restart the parser, as this is a continue message.
494-
delete req.res; // Clear res so that we don't hit double-responses.
498+
req.res = null; // Clear res so that we don't hit double-responses.
495499
req.emit('continue');
496500
return true;
497501
}
Collapse file

‎lib/_http_server.js‎

Copy file name to clipboardExpand all lines: lib/_http_server.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ function Server(requestListener) {
248248
this.timeout = 2 * 60 * 1000;
249249

250250
this._pendingResponseData = 0;
251+
this.maxHeadersCount = null;
251252
}
252253
util.inherits(Server, net.Server);
253254

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.