From 97d0ceeea2fc7749a5f67e85573649e053993098 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sun, 31 May 2015 20:19:11 +1000 Subject: [PATCH] Revert "http: simplify code and remove unused properties" This reverts commit 1eec5f091ab00860539ac2474e47232b31925cea. --- lib/_http_common.js | 6 ++++++ lib/_http_incoming.js | 14 +++----------- lib/_http_outgoing.js | 1 + 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/_http_common.js b/lib/_http_common.js index 757032929444b1..7861848b46a9d4 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -126,6 +126,12 @@ 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); } diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 295a3ef4bd257b..b371c7d7a590f0 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -38,6 +38,8 @@ function IncomingMessage(socket) { this.readable = true; + this._pendings = []; + this._pendingIndex = 0; this.upgrade = null; // request (server) only @@ -47,7 +49,7 @@ function IncomingMessage(socket) { // response (client) only this.statusCode = null; this.statusMessage = null; - this._client = socket; // deprecated + this.client = this.socket; // flag for backwards compatibility grossness. this._consuming = false; @@ -61,16 +63,6 @@ util.inherits(IncomingMessage, Stream.Readable); exports.IncomingMessage = IncomingMessage; -Object.defineProperty(IncomingMessage.prototype, 'client', { - configurable: true, - enumerable: true, - get: util.deprecate(function() { - return this._client; - }, 'client is deprecated, use socket or connection instead'), - set: util.deprecate(function(val) { - this._client = val; - }, 'client is deprecated, use socket or connection instead') -}); IncomingMessage.prototype.setTimeout = function(msecs, callback) { if (callback) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 952b2ed082644a..9a249be6c6ded8 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -62,6 +62,7 @@ function OutgoingMessage() { this._trailer = ''; this.finished = false; + this._hangupClose = false; this._headerSent = false; this.socket = null;