}
/*
- * cmd_mode(): Handles the MODE command. We always use stream mode,
- * so the argument is ignored.
+ * cmd_mode(): Handles the MODE command. Only stream mode is supported.
*/
int cmd_mode(struct conn * const c)
{
- numeric(c, 200, "MODE ignored (always S)");
+ c->recv_buf[0] &= (255-32); /* convert to upper case */
+ if (c->recv_buf[0] == 'S') {
+ numeric(c, 200, "Mode is STREAM.");
+ } else {
+ numeric(c, 504, "Unknown mode.");
+ }
return 1;
}
/*
- * cmd_stru(): Handles the STRU command. We always use file mode,
- * so the argument is ignored.
+ * cmd_stru(): Handles the STRU command. Only file mode is supported.
*/
int cmd_stru(struct conn * const c)
{
- numeric(c, 200, "STRU ignored (always F)");
+ c->recv_buf[0] &= (255-32); /* convert to upper case */
+ if (c->recv_buf[0] == 'F') {
+ numeric(c, 200, "Structure is FILE.");
+ } else {
+ numeric(c, 504, "Unknown structure.");
+ }
return 1;
}
These commands are believed to be fully compliant with RFC959 and RFC1123:
PORT, PASV, USER, PASS, CWD, CDUP, QUIT, DELE, PWD, SYST, NOOP, STOR, APPE,
-ABOR, RNFR, RNTO, MKD, RMD, ALLO, REIN, ACCT, HELP and STAT.
+ABOR, RNFR, RNTO, MKD, RMD, ALLO, REIN, ACCT, HELP, STAT and MODE.
These commands are not implemented at all: SMNT, STOU and SITE.
RFC1123-compliant.)
STRU:
-The STRU command is included, but it ignores its argument and always uses
-file structure (if you really need record structure, mail me; when I'm done
+The STRU command is included, but only file structure is supported (all other
+modes are refused; if you really need record structure, mail me; when I'm done
laughing, I will consider implementing it). RFC959 violation, but RFC1123
excuses the missing record structure.
-MODE:
-The MODE command is included, but it ignores its argument and always uses
-stream mode (the other two are never used anyway). RFC959 violation, it
-requires all other modes to be refused.
-
RETR:
The RETR command is believed to be compliant with RFC959. (There is no default
data port, though -- I'm unsure about this.)