Slightly throttle https large body test

This commit is contained in:
Tim Caswell
2011-01-27 23:37:53 -08:00
committed by Ryan Dahl
parent fda70b8b90
commit 845df3cd2e

View File

@@ -23,7 +23,7 @@ var server = https.createServer(options, function (req, res) {
console.log('got request');
res.writeHead(200, { 'content-type': 'text/plain' });
res.end(body);
})
});
var count = 0;
var gotResEnd = false;
@@ -35,6 +35,10 @@ server.listen(common.PORT, function () {
res.on('data', function(d) {
process.stdout.write('.');
count += d.length;
res.pause();
process.nextTick(function () {
res.resume();
});
});
res.on('end', function(d) {