Skip to content

Commit

Permalink
http: simplify code and remove unused properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed May 1, 2015
1 parent 0450ce7 commit ebe5d52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 0 additions & 6 deletions lib/_http_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ function parserOnMessageComplete() {
parser._url = '';
}

if (!stream.upgrade)
// For upgraded connections, also emit this after parser.execute
stream.push(null);
}

if (stream && !parser.incoming._pendings.length) {
// For emit end event
stream.push(null);
}
Expand Down
13 changes: 10 additions & 3 deletions lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ function IncomingMessage(socket) {

this.readable = true;

this._pendings = [];
this._pendingIndex = 0;
this.upgrade = null;

// request (server) only
Expand All @@ -49,7 +47,6 @@ function IncomingMessage(socket) {
// response (client) only
this.statusCode = null;
this.statusMessage = null;
this.client = this.socket;

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

exports.IncomingMessage = IncomingMessage;

Object.defineProperty(IncomingMessage.prototype, 'client', {
configurable: true,
enumerable: true,
get: util.deprecate(function() {
return this.socket;
}, 'client is deprecated, use socket or connection instead'),
set: util.deprecate(function(val) {
this.socket = this.connection = val;
}, 'client is deprecated, use socket or connection instead')
});

IncomingMessage.prototype.setTimeout = function(msecs, callback) {
if (callback)
Expand Down
1 change: 0 additions & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function OutgoingMessage() {
this._trailer = '';

this.finished = false;
this._hangupClose = false;
this._headerSent = false;

this.socket = null;
Expand Down

0 comments on commit ebe5d52

Please sign in to comment.