Reply Code Complications
A major complaint about the protocol concerns the fact that the writer of an FTP user process must handle a considerable number of special cases merely to determine whether or not the last command sent was successful. It is admitted that the protocol is well-defined in all the following areas, but it is important to realize that the characteristic "well-defined" is necessary, but not sufficient; for many reasons, it is very desirable to employ the simplest mechanism that satisfies all the needs. Following is a list of those drawbacks that unduly complicate the flow chart of an FTP user process:
-
Different commands have different success reply codes. A successful "USER" command, for example, returns a "230" whereas a successful "BYTE" command returns a "200". The concept that success replies should have an even first digit and failure replies an odd first digit does not apply, as "100, means success for "STAT", and "402" means failure for "BYTE". SOLUTION: specify that any command must return a reply code beginning with some unique digit, such as "2", if successful, and anything other than that digit if not successful.
-
Some commands have multiple possible success reply codes, e.g., "USER", "REIN", and "BYE". It is undesirable for an FTP user to be required to keep a list of reply codes for each command, all of which mean "command accepted, continue". SOLUTION: same as for (9.) above. The desire to communicate more specific information than simply "yes" or "no", such as the difficulty in the login procedure that some sites do not need all the parameters, may be solved by having, for example, "238" mean "PASSWORD ACCEPTED, YOU ARE NOW LOGGED IN", and "237" mean "PASSWORD ACCEPTED, ACCOUNT NOW NEEDED" The important point is that the idea of "command accepted" is conveyed by the initial "2", and that finer gradations of meaning can be deduced by the user process, if desired.
-
There are several types of replies that are extraneous from the point of view of a user FTP process, and their reply codes have no characteristic that makes them easily distinguishable. For example, "010 message from operator" and "050 FTP commentary" are superfluous to a user process, and "000 announcing FTP" (in place of "300" greeting) is not. SOLUTION: specify that any reply that has meaning only to a human user and not to a user process must have a reply code beginning with a unique digit, such as "0". The continuation line reply code proposed in (8.) above falls into this category, and therefore must start with the same unique digit.
-
The notion of a server sending a "000 announcing FTP" or a "020 expected delay" immediately after completion of the ICP if input cannot be accepted right away is another instance of multiple reply codes having the same meaning to a user process. SOLUTION: require that the server send a reply with a "020" reply code in the situation cited. If it is desired to communicate more detailed information, the text of the reply may used for this purpose.