mscdex / node-ftp

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

Interrupted Stream does not timeout FTP connection, it hangs script #212

Open laughland opened 6 years ago

laughland commented 6 years ago

We are using node-ftp to get files from our ftp server. Sometimes the network connection is reset and we lose the data stream before it completes. This hangs our script and it never times out - we have to kill the script manually.

I ran the code through a debugger and the following code in connection.js just seems to loop indefinitely; t the keepAlive is just getting reset and running over and over. Here is the code I am referring to:

https://github.com/mscdex/node-ftp/blob/7dff82fc049a52f51803bdffb95ec1de383f9fac/lib/connection.js#L151

We tried using the connTimeout and keepalive options but the connection never times out. We also tried to destroy() the connection but it looks like connection.js is causing the infinite loop.

slavik57 commented 6 years ago

+1

greflm13 commented 5 years ago

+1

yankarlo-test commented 5 years ago

+1