增加网络配置界面

This commit is contained in:
2026-09-10 11:36:33 +08:00
parent 020278d4e3
commit 8e1fd3b2b8
44 changed files with 2488 additions and 332 deletions
+10 -8
View File
@@ -6,6 +6,8 @@
#include <stdbool.h>
#include <ctype.h>
#include "FreeRTOS.h"
#include "lftpd.h"
#include "private/lftpd_status.h"
#include "private/lftpd_inet.h"
@@ -222,14 +224,14 @@ static int cmd_cwd(lftpd_client_t *client, const char *arg)
int is_dir;
if (lftpd_io_stat(path, &size, &is_dir) != 0 || !is_dir) {
send_simple_response(client->socket, 550, STATUS_550);
free(path);
vPortFree(path);
return -1;
}
}
strncpy(client->directory, path, sizeof(client->directory) - 1);
client->directory[sizeof(client->directory) - 1] = '\0';
free(path);
vPortFree(path);
send_simple_response(client->socket, 250, STATUS_250);
return 0;
@@ -248,18 +250,18 @@ static int cmd_dele(lftpd_client_t *client, const char *arg)
int is_dir;
if (lftpd_io_stat(path, &size, &is_dir) != 0) {
send_simple_response(client->socket, 550, STATUS_550);
free(path);
vPortFree(path);
return -1;
}
if (is_dir) {
send_simple_response(client->socket, 550, STATUS_550);
free(path);
vPortFree(path);
return -1;
}
lftpd_io_unlink(path);
free(path);
vPortFree(path);
send_simple_response(client->socket, 250, STATUS_250);
return 0;
}
@@ -459,7 +461,7 @@ static int cmd_retr(lftpd_client_t *client, const char *arg)
lftpd_log_error("DOWNLOAD '%s' FAILED", path);
send_simple_response(client->socket, 450, STATUS_450);
}
free(path);
vPortFree(path);
return 0;
}
@@ -481,7 +483,7 @@ static int cmd_size(lftpd_client_t *client, const char *arg)
send_simple_response(client->socket, 550, STATUS_550);
}
free(path);
vPortFree(path);
return 0;
}
@@ -518,7 +520,7 @@ static int cmd_stor(lftpd_client_t *client, const char *arg)
lftpd_log_error("UPLOAD '%s' FAILED", path);
send_simple_response(client->socket, 450, STATUS_450);
}
free(path);
vPortFree(path);
return 0;
}