This commit is contained in:
Andrew Pamment
2018-05-31 21:29:08 +10:00
parent e63488b5a2
commit 0e449b22dd
2 changed files with 4 additions and 12 deletions

View File

@@ -355,9 +355,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");
@@ -522,9 +520,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) {
@@ -573,9 +569,7 @@ void handle_LIST(struct ftpserver *cfg, struct ftpclient *client) {
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) {
dirp = opendir(newpath);