]> git.sesse.net Git - betaftpd/commitdiff
Fixed a problem where unknown commands would just cause the connection to hang, more...
authorsgunderson <sgunderson>
Tue, 9 Oct 2001 21:17:39 +0000 (21:17 +0000)
committersgunderson <sgunderson>
Tue, 9 Oct 2001 21:17:39 +0000 (21:17 +0000)
cmds.c

diff --git a/cmds.c b/cmds.c
index 3c917905cf990e24c22d9e3183a71c2eefa230bc..e1fe248f1cb3c5c9626119a619b95430e24c8830 100644 (file)
--- 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);
+       }
 }
 
 /*