fix ftpd
This commit is contained in:
parent
e63488b5a2
commit
0e449b22dd
@ -355,9 +355,7 @@ void handle_STOR(struct ftpserver *cfg, struct ftpclient *client, char *path) {
|
|||||||
} else if (pid < 0) {
|
} else if (pid < 0) {
|
||||||
send_msg(client, "451 STOR Failed.\r\n");
|
send_msg(client, "451 STOR Failed.\r\n");
|
||||||
} else {
|
} else {
|
||||||
client->data_socket = -1;
|
close_tcp_connection(client);
|
||||||
memset(client->data_ip, 0, INET6_ADDRSTRLEN);
|
|
||||||
client->data_srv_socket = -1;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
send_msg(client, "553 File Exists.\n");
|
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) {
|
if (pid > 0) {
|
||||||
// nothing
|
// nothing
|
||||||
client->data_socket = -1;
|
close_tcp_connection(client);
|
||||||
memset(client->data_ip, 0, INET6_ADDRSTRLEN);
|
|
||||||
client->data_srv_socket = -1;
|
|
||||||
|
|
||||||
} else if (pid == 0) {
|
} else if (pid == 0) {
|
||||||
|
|
||||||
@ -573,9 +569,7 @@ void handle_LIST(struct ftpserver *cfg, struct ftpclient *client) {
|
|||||||
|
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
// nothing
|
// nothing
|
||||||
client->data_socket = -1;
|
close_tcp_connection(client);
|
||||||
memset(client->data_ip, 0, INET6_ADDRSTRLEN);
|
|
||||||
client->data_srv_socket = -1;
|
|
||||||
} else if (pid == 0) {
|
} else if (pid == 0) {
|
||||||
dirp = opendir(newpath);
|
dirp = opendir(newpath);
|
||||||
|
|
||||||
|
@ -645,9 +645,7 @@ void handle_LIST(struct ftpserver *cfg, struct ftpclient *client) {
|
|||||||
|
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
// nothing
|
// nothing
|
||||||
client->data_socket = -1;
|
close_tcp_connection(client);
|
||||||
memset(client->data_ip, 0, INET6_ADDRSTRLEN);
|
|
||||||
client->data_srv_socket = -1;
|
|
||||||
} else if (pid == 0) {
|
} else if (pid == 0) {
|
||||||
if (client->current_path == NULL) {
|
if (client->current_path == NULL) {
|
||||||
if (!open_tcp_connection(cfg, client)) {
|
if (!open_tcp_connection(cfg, client)) {
|
||||||
|
Reference in New Issue
Block a user