ReferenceError shortly after issuing a raw quit #19

Closed
rickysaltzer opened this Issue Feb 16, 2012 · 2 comments

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:

jsftp/jsftp.js:176
                    !err && send();
                     ^
ReferenceError: err is not defined
    jsftp/jsftp.js:176:22
    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: https://gist.github.com/1846894

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 user...an 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: https://gist.github.com/2138255.

Owner

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