ReferenceError shortly after issuing a raw quit #19

rickysaltzer opened this Issue Feb 16, 2012 · 2 comments


3 participants

Hi there -

Shortly after issuing a raw quit on my FTP connection I an receiving an error complaining that err is not defined. See below:

                    !err && send();
ReferenceError: err is not defined
    at Socket.<anonymous> (jsftp/jsftp.js:267:26)
    at Socket.emit (events.js:88:20)
    at Object.afterConnect [as oncomplete] (net.js:616:10)

Path names to the files have been shortened.

Here is my code:

Upload file takes (input file, output file name, res)...res being the response object for the node web server. At the end of the upload I'm sending a "upload complete" message to the user, right after quitting. However, shortly after disconnecting the session and notifying the error takes down the whole application.

This affected me too. From what I can figure out, this happens because jsftp uses setInterval to periodically send the Keep Alive command ("noop"), and the interval isn't cleared once a QUIT command is sent. I fixed this by replacing line 108 in the jsftp module with this:


sergi commented Apr 18, 2012

It should be fixed now. Can you test?

sergi closed this May 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment