Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit fee3a98

Browse files
authored
Merge pull request #49 from mattbradford83/master
Allow captive portal to run more than once by closing dnsServer cleanly.
2 parents 88571d9 + eb22ade commit fee3a98

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ESPAsync_WiFiManager-Impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ bool ESPAsync_WiFiManager::startConfigPortal(char const *apName, char const *ap
911911

912912
#if !( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_PROS2 || ARDUINO_MICROS2 )
913913
server->reset();
914-
*dnsServer = DNSServer();
914+
dnsServer->stop();
915915
#endif
916916

917917
return WiFi.status() == WL_CONNECTED;

src_cpp/ESPAsync_WiFiManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ bool ESPAsync_WiFiManager::startConfigPortal(char const *apName, char const *ap
908908

909909
#if !( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_PROS2 || ARDUINO_MICROS2 )
910910
server->reset();
911-
*dnsServer = DNSServer();
911+
dnsServer->stop();
912912
#endif
913913

914914
return WiFi.status() == WL_CONNECTED;

src_h/ESPAsync_WiFiManager-Impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ bool ESPAsync_WiFiManager::startConfigPortal(char const *apName, char const *ap
911911

912912
#if !( ARDUINO_ESP32S2_DEV || ARDUINO_FEATHERS2 || ARDUINO_PROS2 || ARDUINO_MICROS2 )
913913
server->reset();
914-
*dnsServer = DNSServer();
914+
dnsServer->stop();
915915
#endif
916916

917917
return WiFi.status() == WL_CONNECTED;

0 commit comments

Comments
 (0)