From b1ef6e5dca3aeada004fcd6377416acf9d26bf12 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 9 Aug 2016 12:13:09 +1000 Subject: [PATCH] Add pause/resume handling to part passed to onPart. Prevents buffering if part is pipe'd. --- lib/incoming_form.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/incoming_form.js b/lib/incoming_form.js index b4234456..ab9e58bc 100644 --- a/lib/incoming_form.js +++ b/lib/incoming_form.js @@ -336,6 +336,13 @@ IncomingForm.prototype._initMultipart = function(boundary) { part.transferEncoding = 'binary'; part.transferBuffer = ''; + part.pause = function() { + self.pause(); + }; + part.resume = function() { + self.resume(); + }; + headerField = ''; headerValue = ''; };