}
/*
- * 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;
}