瀏覽代碼

Merge pull request #43 from debsahu/master

#32 + AsyncDNS type update
Alan Steremberg 6 年之前
父節點
當前提交
b8be526571
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      ESPAsyncWiFiManager.cpp

+ 8 - 2
ESPAsyncWiFiManager.cpp

@@ -115,7 +115,11 @@ void AsyncWiFiManager::setupConfigPortal() {
   DEBUG_WM(WiFi.softAPIP());
 
   /* Setup the DNS server redirecting all the domains to the apIP */
+  #ifdef USE_EADNS
+  dnsServer->setErrorReplyCode(AsyncDNSReplyCode::NoError);
+  #else
   dnsServer->setErrorReplyCode(DNSReplyCode::NoError);
+  #endif
   dnsServer->start(DNS_PORT, "*", WiFi.softAPIP());
 
   setInfo();
@@ -442,8 +446,10 @@ boolean  AsyncWiFiManager::startConfigPortal(char const *apName, char const *apP
   scannow= -1 ;
   while (_configPortalTimeout == 0 || millis() < _configPortalStart + _configPortalTimeout) {
     //DNS
-    //dnsServer->processNextRequest();
-
+    #ifndef USE_EADNS	
+    dnsServer->processNextRequest();
+    #endif
+	
     //
     //  we should do a scan every so often here
     //