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.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js
index a84cb64bdb..55c196399c 100644
--- a/lib/_http_incoming.js
+++ b/lib/_http_incoming.js
@@ -38,6 +38,8 @@ function readStop(socket) {
function IncomingMessage(socket) {
Stream.Readable.call(this);
+ this._readableState.readingMore = true;
+
this.socket = socket;
this.connection = socket;
@@ -63,6 +65,7 @@ function IncomingMessage(socket) {
this.statusMessage = null;
this.client = socket;
+ this._consuming = false;
// flag for when we decide that this message cannot possibly be
// read by the user, so there's no point continuing to handle it.
this._dumped = false;
@@ -79,6 +82,11 @@ IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
IncomingMessage.prototype._read = function _read(n) {
+ if (!this._consuming) {
+ this._readableState.readingMore = false;
+ this._consuming = true;
+ }
+
// We actually do almost nothing here, because the parserOnBody
// function fills up our internal buffer directly. However, we
// do need to unpause the underlying socket so that it flows.