diff --git a/src/net/nl_http_server.c b/src/net/nl_http_server.c index 89e7cf0..9eb7020 100644 --- a/src/net/nl_http_server.c +++ b/src/net/nl_http_server.c @@ -96,6 +96,11 @@ static void server_task(void *arg) if (ls < 0 || bind(ls, (struct sockaddr *)&addr, sizeof addr) != 0 || listen(ls, 4) != 0) { if (ls >= 0) closesocket(ls); + /* I4: keep the heartbeat ticking while retrying. app_task only feeds the watchdog + * once all three heartbeats moved, so without this a failing socket()/bind()/listen() + * (e.g. no netif yet, or lwIP temporarily out of memory) would reset the chip after + * 20 s, boot, fail again - forever. The retry itself is the recovery, not a reboot. */ + nl_http_beat++; tls_os_time_delay(HZ); continue; }