mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 243 forks source link

当下载大量的文件到本地的时候,程序会出现假死现象; ftp._curReq || ftp._queue存在已有任务,后续任务无法继续 #243

Open 18772894357 opened 5 years ago

18772894357 commented 5 years ago

ftp.on('ready', () => { ftp.size(filename, (err, size) => { ftp.get(filename, (err, stream) => { res.writeHead(200, { 'Content-Type': 'application/force-download', 'Content-Disposition': 'attachment; filename=' + filename, 'Content-length': size }); stream.pipe(res); stream.once('close', function() { ftp.end(); }); }); }) })