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

Commit e4a2de1

Browse files
committed
Switch DNSServer to AsyncDNSServer in src
1 parent 41f6479 commit e4a2de1

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/ESPAsync_WiFiManager-Impl.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ char* ESPAsync_WiFiManager::getRFC952_hostname(const char* iHostname)
182182

183183
//////////////////////////////////////////
184184

185-
ESPAsync_WiFiManager::ESPAsync_WiFiManager(AsyncWebServer * webserver, DNSServer *dnsserver, const char *iHostname)
185+
ESPAsync_WiFiManager::ESPAsync_WiFiManager(AsyncWebServer * webserver, AsyncDNSServer *dnsserver, const char *iHostname)
186186
{
187187

188188
server = webserver;
@@ -328,7 +328,7 @@ void ESPAsync_WiFiManager::setupConfigPortal()
328328
#endif
329329

330330
if (!dnsServer)
331-
dnsServer = new DNSServer;
331+
dnsServer = new AsyncDNSServer;
332332
#endif // ( USING_ESP32_S2 || USING_ESP32_C3 )
333333

334334
// optional soft ip config
@@ -344,7 +344,7 @@ void ESPAsync_WiFiManager::setupConfigPortal()
344344
/* Setup the DNS server redirecting all the domains to the apIP */
345345
if (dnsServer)
346346
{
347-
dnsServer->setErrorReplyCode(DNSReplyCode::NoError);
347+
dnsServer->setErrorReplyCode(AsyncDNSReplyCode::NoError);
348348

349349
// DNSServer started with "*" domain name, all DNS requests will be passsed to WiFi.softAPIP()
350350
if (! dnsServer->start(DNS_PORT, "*", WiFi.softAPIP()))
@@ -756,9 +756,6 @@ void ESPAsync_WiFiManager::criticalLoop()
756756

757757
void ESPAsync_WiFiManager::safeLoop()
758758
{
759-
#ifndef USE_EADNS
760-
dnsServer->processNextRequest();
761-
#endif
762759
}
763760

764761
///////////////////////////////////////////////////////////
@@ -807,10 +804,7 @@ bool ESPAsync_WiFiManager::startConfigPortal(char const *apName, char const *ap
807804
#if ( USING_ESP32_S2 || USING_ESP32_C3 )
808805
// Fix ESP32-S2 issue with WebServer (https://github.com/espressif/arduino-esp32/issues/4348)
809806
delay(1);
810-
#else
811-
//DNS
812-
if (dnsServer)
813-
dnsServer->processNextRequest();
807+
#else
814808

815809
//
816810
// we should do a scan every so often here and

src/ESPAsync_WiFiManager.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
#include <ESPAsyncWebServer.h>
205205
#endif
206206

207-
#include <DNSServer.h>
207+
#include <ESPAsyncDNSServer.h>
208208
#include <memory>
209209
#undef min
210210
#undef max
@@ -470,7 +470,7 @@ class ESPAsync_WiFiManager
470470
{
471471
public:
472472

473-
ESPAsync_WiFiManager(AsyncWebServer * webserver, DNSServer *dnsserver, const char *iHostname = "");
473+
ESPAsync_WiFiManager(AsyncWebServer * webserver, AsyncDNSServer *dnsserver, const char *iHostname = "");
474474

475475
~ESPAsync_WiFiManager();
476476

@@ -736,7 +736,7 @@ class ESPAsync_WiFiManager
736736

737737
private:
738738

739-
DNSServer *dnsServer;
739+
AsyncDNSServer *dnsServer;
740740

741741
AsyncWebServer *server;
742742

0 commit comments

Comments
 (0)