mscdex / node-ftp

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

ABOR behavior #170

Open morris opened 7 years ago

morris commented 7 years ago

Looking at https://github.com/mscdex/node-ftp/blob/master/lib/connection.js#L435 it looks like the callback of LIST could be called without error and without a file list, namely if there's an ABOR command queued. What's the semantic of that? I'd expect some "cannot use forEach of undefined" errors pop up in that case in client code. Example here https://github.com/morris/vinyl-ftp/issues/65

I'd expect an error, because the operation was not completed (even if ABOR was issued by the client himself). In that case, the client may handle the "Aborted" error manually.

kpromedia commented 6 years ago

I don't know if this concerns your issue, if not please just ignore this.

Also having trouble with ABOR behavior.

It just aborts after switching to passive mode and triggers my put callback twice (wtf?), i do not know why but it always kills my async-queue what is pretty annoying.

[FTP-Connection 10][connection] > 'PASV'
[FTP-Connection 10][connection] < '227 Entering Passive Mode (xx,xx,xx,xx,xx,xx).\r\n'
[FTP-Connection 10][parser] < '227 Entering Passive Mode (xx,xx,xx,xx,xx,xx).\r\n'
[FTP-Connection 10][parser] Response: code=227, buffer='Entering Passive Mode (xx,xx,xx,xx,xx,xx).'
[FTP-Connection 10][connection] PASV socket connected
[FTP-Connection 10][connection] > 'ABOR'
[FTP-Connection 10][connection] < '226 Abort successful\r\n'
[FTP-Connection 10][parser] < '226 Abort successful\r\n'
[FTP-Connection 10][parser] Response: code=226, buffer='Abort successful'

Also this output shows me that there is nothing wrong about that so I do not get why there is an ABOR command.