From 144b48f53110d4c186f5deafd1d1365e0a140331 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 22:58:01 +0530 Subject: fix: use default httpd socket settings to prevent socket exhaustion - Remove max_open_sockets=2 override from both httpd servers (use ESP-IDF default of 4) - Increase LWIP_MAX_SOCKETS from 16 to 20 (matching standalone tollgate) - The previous custom tuning (max_open_sockets=2, keep_alive_enable=false, linger_timeout=0) caused socket leaks by interfering with ESP-IDF's internal session management - Verified: 50/50 sequential requests pass, full payment flow works --- main/captive_portal.c | 1 - main/tollgate_api.c | 1 - sdkconfig | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/main/captive_portal.c b/main/captive_portal.c index fc21d09..ed14c38 100644 --- a/main/captive_portal.c +++ b/main/captive_portal.c @@ -313,7 +313,6 @@ esp_err_t captive_portal_start(const char *ap_ip_str) httpd_config_t config = HTTPD_DEFAULT_CONFIG(); config.stack_size = 16384; config.max_uri_handlers = 20; - config.max_open_sockets = 2; config.uri_match_fn = httpd_uri_match_wildcard; esp_err_t ret = httpd_start(&s_server, &config); diff --git a/main/tollgate_api.c b/main/tollgate_api.c index 9b4612d..71056cf 100644 --- a/main/tollgate_api.c +++ b/main/tollgate_api.c @@ -390,7 +390,6 @@ esp_err_t tollgate_api_start(void) config.server_port = 2121; config.ctrl_port = 32769; config.max_uri_handlers = 16; - config.max_open_sockets = 2; config.stack_size = 16384; esp_err_t ret = httpd_start(&s_api_server, &config); diff --git a/sdkconfig b/sdkconfig index 92a21eb..fbca7e1 100644 --- a/sdkconfig +++ b/sdkconfig @@ -1526,7 +1526,7 @@ CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_IRAM_OPTIMIZATION is not set # CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y -CONFIG_LWIP_MAX_SOCKETS=16 +CONFIG_LWIP_MAX_SOCKETS=20 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set # CONFIG_LWIP_SO_LINGER is not set CONFIG_LWIP_SO_REUSE=y -- cgit v1.2.3