summaryrefslogtreecommitdiff
path: root/lib/_http_incoming.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r--lib/_http_incoming.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js
index 6e66ae6d42..4d1c3ea810 100644
--- a/lib/_http_incoming.js
+++ b/lib/_http_incoming.js
@@ -20,6 +20,13 @@ exports.readStop = readStop;
function IncomingMessage(socket) {
Stream.Readable.call(this);
+ // Set this to `true` so that stream.Readable won't attempt to read more
+ // data on `IncomingMessage#push` (see `maybeReadMore` in
+ // `_stream_readable.js`). This is important for proper tracking of
+ // `IncomingMessage#_consuming` which is used to dump requests that users
+ // haven't attempted to read.
+ this._readableState.readingMore = true;
+
this.socket = socket;
this.connection = socket;
@@ -67,6 +74,8 @@ IncomingMessage.prototype.setTimeout = function(msecs, callback) {
IncomingMessage.prototype.read = function(n) {
+ if (!this._consuming)
+ this._readableState.readingMore = false;
this._consuming = true;
this.read = Stream.Readable.prototype.read;
return this.read(n);