feat: harden errors, recovery, and resource usage

This commit is contained in:
2026-08-29 23:40:37 +03:00
parent c8e0c9168b
commit d67fd327c9
10 changed files with 525 additions and 32 deletions
+2 -2
View File
@@ -277,10 +277,10 @@ bool http_api_handle(http_api_t *api, const http_api_request_t *request, http_ap
if (request->route == HTTP_API_ROUTE_HEALTH && request->method == HTTP_API_GET) {
response_write(response, 200U, "{\"ok\":true,\"uptimeMs\":%" PRIu32 ",\"wifiState\":\"%s\",\"freeHeapBytes\":%" PRIu32
",\"minimumFreeHeapBytes\":%" PRIu32 ",\"largestFreeBlockBytes\":%" PRIu32
",\"connectedClients\":%u,\"rejectedInput\":%u}", api->health.uptime_ms,
",\"connectedClients\":%u,\"rejectedInput\":%u,\"resetReason\":%d}", api->health.uptime_ms,
api->health.wifi_state == NULL ? "unknown" : api->health.wifi_state, api->health.free_heap_bytes,
api->health.minimum_free_heap_bytes, api->health.largest_free_block_bytes,
api->health.connected_clients, api->health.rejected_input);
api->health.connected_clients, api->health.rejected_input, api->health.reset_reason);
return response->body_length <= 320U;
}
if (request->route == HTTP_API_ROUTE_STATE && request->method == HTTP_API_GET) {