server
server copied to clipboard
Fix data transfer error code
I believe that when the file transfer fails, the error is permanent 5xx. Some clients (e.g. lftp) at the moment are confused by the temporary 4xx error and they retry to upload the file.
according http://cr.yp.to/ftp/stor.html, maybe 550 is not a correct response.
Thanks @lunny can you check if this is acceptable?
400 Series The command was not accepted and the requested action did not take place, but the error condition is temporary and the action may be requested again.
421 Service not available, closing control connection. This may be a reply to any command if the service knows it must shut down.
425 Can't open data connection.
426 Connection closed; transfer aborted.
430 Invalid username or password
434 Requested host unavailable.
450 Requested file action not taken.
451 Requested action aborted. Local error in processing.
452 Requested action not taken. Insufficient storage space in system.File unavailable (e.g., file busy).
500 Series Syntax error, command unrecognized and the requested action did not take place. This may include errors such as command line too long.
501 Syntax error in parameters or arguments.
502 Command not implemented.
503 Bad sequence of commands.
504 Command not implemented for that parameter.
530 Not logged in.
532 Need account for storing files.
550 Requested action not taken. File unavailable (e.g., file not found, no access).
551 Requested action aborted. Page type unknown.
552 Requested file action aborted. Exceeded storage allocation (for current directory or dataset).
553 Requested action not taken. File name not allowed.
According to the above list, I think we have to know the returned err to decide return 450 or 553.
The difference between 450 and 553 is that 553 is file name is not allowed error.