diff --git a/esphome/components/captive_portal/captive_portal.cpp b/esphome/components/captive_portal/captive_portal.cpp index c2d3f63837e..0ad06d49adc 100644 --- a/esphome/components/captive_portal/captive_portal.cpp +++ b/esphome/components/captive_portal/captive_portal.cpp @@ -63,7 +63,7 @@ void CaptivePortal::start() { this->base_->init(); if (!this->initialized_) { this->base_->add_handler(this); -#ifdef USE_ESP_IDF +#ifdef USE_ESP32 // Enable LRU socket purging to handle captive portal detection probe bursts // OS captive portal detection makes many simultaneous HTTP requests which can // exhaust sockets. LRU purging automatically closes oldest idle connections. diff --git a/esphome/components/captive_portal/captive_portal.h b/esphome/components/captive_portal/captive_portal.h index e98a2b65115..ae9b9dfba0f 100644 --- a/esphome/components/captive_portal/captive_portal.h +++ b/esphome/components/captive_portal/captive_portal.h @@ -40,7 +40,7 @@ class CaptivePortal : public AsyncWebHandler, public Component { void end() { this->active_ = false; this->disable_loop(); // Stop processing DNS requests -#ifdef USE_ESP_IDF +#ifdef USE_ESP32 // Disable LRU socket purging now that captive portal is done this->base_->get_server()->set_lru_purge_enable(false); #endif