Skip to content

Commit 5de04da

Browse files
felixgery
authored andcommitted
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(); }); }
1 parent e6c5ac4 commit 5de04da

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/multipart.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ proto.init = function(options) {
5353
var self = this;
5454
req
5555
.addListener('body', function(chunk) {
56-
req.pause();
5756
self.write(chunk);
58-
setTimeout(function() {
59-
req.resume();
60-
});
6157
})
6258
.addListener('complete', function() {
6359
self.emit('complete');

0 commit comments

Comments
 (0)