From: sgunderson Date: Tue, 9 Oct 2001 21:17:39 +0000 (+0000) Subject: Fixed a problem where unknown commands would just cause the connection to hang, more... X-Git-Url: https://git.sesse.net/?p=betaftpd;a=commitdiff_plain;h=793127e4a4c9a04d31a7708cc765e460c0d3f603 Fixed a problem where unknown commands would just cause the connection to hang, more or less (related to the numeric cleanups). --- diff --git a/cmds.c b/cmds.c index 3c91790..e1fe248 100644 --- a/cmds.c +++ b/cmds.c @@ -1622,8 +1622,12 @@ void parse_command(struct conn *c) } } while ((++h)->callback != NULL); - numeric(c, 500, "Sorry, no such command."); remove_bytes(c, cmlen); + { + char error[] = "500 Sorry, no such command.\r\n"; + if (send(c->sock, error, strlen(error), 0) == -1 && errno == EPIPE) + destroy_conn(c); + } } /*