summaryrefslogtreecommitdiff
path: root/lib/_http_incoming.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-10-10 15:00:05 -0700
committerisaacs <i@izs.me>2013-10-16 11:01:33 -0700
commit085dd30e93da67362f044ad1b3b6b2d997064692 (patch)
tree0eac49c21335d8bb399256582b9100bbd6c6a0d5 /lib/_http_incoming.js
parentab037455094c9e3b9922ae2a380911b2b41ba7ce (diff)
downloadandroid-node-v8-085dd30e93da67362f044ad1b3b6b2d997064692.tar.gz
android-node-v8-085dd30e93da67362f044ad1b3b6b2d997064692.tar.bz2
android-node-v8-085dd30e93da67362f044ad1b3b6b2d997064692.zip
http: provide backpressure for pipeline flood
If a client sends a lot more pipelined requests than we can handle, then we need to provide backpressure so that the client knows to back off. Do this by pausing both the stream and the parser itself when the responses are not being read by the downstream client. Fix GH-6214
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r--lib/_http_incoming.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js
index cc93bfc9f1..2f66400247 100644
--- a/lib/_http_incoming.js
+++ b/lib/_http_incoming.js
@@ -23,7 +23,7 @@ var util = require('util');
var Stream = require('stream');
function readStart(socket) {
- if (socket)
+ if (socket && !socket._paused && socket.readable)
socket.resume();
}
exports.readStart = readStart;