1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 15:55:46 +00:00
This commit is contained in:
J. Nick Koston
2025-11-17 22:11:27 -06:00
parent 11c8865248
commit bbfff42f76

View File

@@ -101,6 +101,9 @@ void AsyncWebServer::begin() {
httpd_config_t config = HTTPD_DEFAULT_CONFIG(); httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.server_port = this->port_; config.server_port = this->port_;
config.uri_match_fn = [](const char * /*unused*/, const char * /*unused*/, size_t /*unused*/) { return true; }; config.uri_match_fn = [](const char * /*unused*/, const char * /*unused*/, size_t /*unused*/) { return true; };
// Enable LRU purging to close oldest idle connections when socket limit is reached
// This prevents socket exhaustion when multiple clients connect (e.g., captive portal probes)
config.lru_purge_enable = true;
if (httpd_start(&this->server_, &config) == ESP_OK) { if (httpd_start(&this->server_, &config) == ESP_OK) {
const httpd_uri_t handler_get = { const httpd_uri_t handler_get = {
.uri = "", .uri = "",