Skip to content

Commit ebe5d52

Browse files
committed
http: simplify code and remove unused properties
1 parent 0450ce7 commit ebe5d52

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

lib/_http_common.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ function parserOnMessageComplete() {
126126
parser._url = '';
127127
}
128128

129-
if (!stream.upgrade)
130-
// For upgraded connections, also emit this after parser.execute
131-
stream.push(null);
132-
}
133-
134-
if (stream && !parser.incoming._pendings.length) {
135129
// For emit end event
136130
stream.push(null);
137131
}

lib/_http_incoming.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ function IncomingMessage(socket) {
3838

3939
this.readable = true;
4040

41-
this._pendings = [];
42-
this._pendingIndex = 0;
4341
this.upgrade = null;
4442

4543
// request (server) only
@@ -49,7 +47,6 @@ function IncomingMessage(socket) {
4947
// response (client) only
5048
this.statusCode = null;
5149
this.statusMessage = null;
52-
this.client = this.socket;
5350

5451
// flag for backwards compatibility grossness.
5552
this._consuming = false;
@@ -63,6 +60,16 @@ util.inherits(IncomingMessage, Stream.Readable);
6360

6461
exports.IncomingMessage = IncomingMessage;
6562

63+
Object.defineProperty(IncomingMessage.prototype, 'client', {
64+
configurable: true,
65+
enumerable: true,
66+
get: util.deprecate(function() {
67+
return this.socket;
68+
}, 'client is deprecated, use socket or connection instead'),
69+
set: util.deprecate(function(val) {
70+
this.socket = this.connection = val;
71+
}, 'client is deprecated, use socket or connection instead')
72+
});
6673

6774
IncomingMessage.prototype.setTimeout = function(msecs, callback) {
6875
if (callback)

lib/_http_outgoing.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ function OutgoingMessage() {
6262
this._trailer = '';
6363

6464
this.finished = false;
65-
this._hangupClose = false;
6665
this._headerSent = false;
6766

6867
this.socket = null;

0 commit comments

Comments
 (0)