From: Felix Geisendörfer Date: Sun, 20 Dec 2009 19:27:06 +0000 (+0100) Subject: Do not pause request for multipart parsing X-Git-Tag: v0.1.23~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5de04dafc6c21cbfedc0f89859a21066e2741295;p=platform%2Fupstream%2Fnodejs.git Do not pause request for multipart parsing This is actually undesireable as it takes away control from the user who may want to pause/resume to throttle the upload stream, or synchronize it with disk flushing. I actually ran into memory issues when trying to stream huge files to disc as the file module was building up a huge action buffer. This can now easily be avoided like this: part.addListener('body', function(chunk) { req.pause(); file.write(chunk).addCallback(function() { req.resume(); }); } --- diff --git a/lib/multipart.js b/lib/multipart.js index c700788..899b2d1 100644 --- a/lib/multipart.js +++ b/lib/multipart.js @@ -53,11 +53,7 @@ proto.init = function(options) { var self = this; req .addListener('body', function(chunk) { - req.pause(); self.write(chunk); - setTimeout(function() { - req.resume(); - }); }) .addListener('complete', function() { self.emit('complete');