From 89f26218fbbf6a8985756c55ba2fb4fef0eccb47 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 20 Jul 2018 08:13:18 +0200 Subject: [PATCH] Fixed forced paused flowMode issue By using the readable event the paused flowMode is forced upon the stream, even though the use of pipe() later on. By explicitly calling stream.read() on the readable event the pipe will function normally --- lib/jsftp.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jsftp.js b/lib/jsftp.js index ebd8e8f..a84fff8 100644 --- a/lib/jsftp.js +++ b/lib/jsftp.js @@ -458,6 +458,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback = NOOP) { action: "get", socket: socket }); + socket.read(); }); // This ensures that any expected outcome is handled. There is no @@ -545,6 +546,7 @@ Ftp.prototype.put = function(from, destination, callback) { socket: from, totalSize }); + from.read(); }); this.getPutSocket(from, to, callback);