DNS server stop independent of webserver type

In some situations (not passing a WebServer instance from external) the
DNS server was not stopped in _stopPortal(). Maybe the intention was here not
to stopped an externally passed WebServer but I see no use-case for the
dns server here.

Fixed this to remove the enum handling in the next step.
pull/144/head
Sven Steckmann 5 years ago
parent b4682dd8d4
commit ddade99c43
  1. 8
      src/AutoConnect.cpp

@ -385,13 +385,11 @@ void AutoConnect::end(void) {
}
_stopPortal();
_dnsServer.reset();
if (_webServer) {
switch (_webServerAlloc) {
case AC_WEBSERVER_HOSTED:
if (_dnsServer) {
_dnsServer->stop();
_dnsServer.reset();
}
_webServer.reset();
break;
case AC_WEBSERVER_PARASITIC:
@ -686,7 +684,7 @@ bool AutoConnect::_loadAvailCredential(const char* ssid) {
* Stops DNS server and flush tcp sending.
*/
void AutoConnect::_stopPortal(void) {
if (_dnsServer && _webServerAlloc == AC_WEBSERVER_HOSTED)
if (_dnsServer)
_dnsServer->stop();
if (_webServer) {

Loading…
Cancel
Save