修复了网络参数的保存逻辑

This commit is contained in:
2026-09-10 14:21:07 +08:00
parent 2b80d34e74
commit 4515ee4c80
24 changed files with 1457 additions and 72 deletions
+8
View File
@@ -57,11 +57,19 @@ int lftpd_inet_get_socket_port(int socket)
int lftpd_inet_accept(int socket)
{
/* 网络重建(net_init)后旧 Socket 已失效:检测到代次变化即返回 -1,
* 由 lftpd_start 外层循环重建监听(网络未就绪时其 listen 会重试) */
uint32_t gen = net_get_generation();
while (1) {
int s = net_accept(socket, NULL, NULL);
if (s >= 0) {
return s;
}
if (net_get_generation() != gen) {
DBG_ERROR("network re-init: abort accept, relisten");
return -1;
}
vTaskDelay(pdMS_TO_TICKS(100));
}
}