测试程序可以使用

This commit is contained in:
2026-07-21 23:05:20 +08:00
parent 46a74f24f3
commit 038a2542af
4 changed files with 361 additions and 40 deletions

View File

@@ -350,7 +350,14 @@ static int cmd_pass(lftpd_client_t *client, const char *arg)
static int cmd_pasv(lftpd_client_t *client, const char *arg)
{
int listener_socket = lftpd_inet_listen(0);
int listener_socket = -1;
int retry;
for (retry = 0; retry < 3; retry++) {
listener_socket = lftpd_inet_listen(0);
if (listener_socket >= 0) break;
vTaskDelay(pdMS_TO_TICKS(200));
}
if (listener_socket < 0) {
send_simple_response(client->socket, 425, STATUS_425);
return -1;