fix: harden tcp tasks around link readiness and connect retries

This commit is contained in:
2026-04-22 23:59:46 +08:00
parent afd90d357c
commit e3450fd0ad
2 changed files with 33 additions and 12 deletions
+2 -5
View File
@@ -58,17 +58,14 @@ static void tcp_server_task(uint8_t link_index)
struct netconn *listener;
struct netconn *newconn;
netconn_thread_init();
for (;;) {
while (g_netif_ready == pdFALSE) {
vTaskDelay(pdMS_TO_TICKS(100));
}
cfg = config_get();
debug_log_printf("[SRV] idx=%u hwm=%lu en=%u port=%u\r\n",
(unsigned int)link_index,
(unsigned long)uxTaskGetStackHighWaterMark(NULL),
(unsigned int)cfg->links[link_index].enabled,
(unsigned int)cfg->links[link_index].local_port);
if (cfg->links[link_index].enabled == 0u) {
vTaskDelay(pdMS_TO_TICKS(500));
continue;