diff --git a/utils/mnetftpd/mnetftpd.c b/utils/mnetftpd/mnetftpd.c index 79dea2f..d37a677 100644 --- a/utils/mnetftpd/mnetftpd.c +++ b/utils/mnetftpd/mnetftpd.c @@ -391,9 +391,7 @@ void handle_STOR(struct ftpserver *cfg, struct ftpclient *client, char *path) { } else if (pid < 0) { send_msg(client, "451 STOR Failed.\r\n"); } else { - client->data_socket = -1; - memset(client->data_ip, 0, INET6_ADDRSTRLEN); - client->data_srv_socket = -1; + close_tcp_connection(client); } } else { send_msg(client, "553 File Exists.\n"); @@ -600,10 +598,7 @@ void handle_RETR(struct ftpserver *cfg, struct ftpclient *client, char *file) { if (pid > 0) { // nothing - client->data_socket = -1; - memset(client->data_ip, 0, INET6_ADDRSTRLEN); - client->data_srv_socket = -1; - + close_tcp_connection(client); } else if (pid == 0) { if (stat(fullpath, &s) == 0) {