Refactor webserver ip address

This commit is contained in:
Theo Arends 2021-01-25 17:25:56 +01:00
parent 7612cb54c6
commit 069cf7390c
1 changed files with 6 additions and 8 deletions

View File

@ -475,17 +475,15 @@ void StartWebserver(int type, IPAddress ipweb)
#if LWIP_IPV6 #if LWIP_IPV6
String ipv6_addr = WifiGetIPv6(); String ipv6_addr = WifiGetIPv6();
if (ipv6_addr!="") { if (ipv6_addr!="") {
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %s and IPv6 global address %s "), AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %_I and IPv6 global address %s "),
NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", ipweb.toString().c_str(), ipv6_addr.c_str()); NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", (uint32_t)ipweb, ipv6_addr.c_str());
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %s"), AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %_I"),
NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", ipweb.toString().c_str()); NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", (uint32_t)ipweb);
} }
#else #else
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %s"), AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %_I"),
NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", ipweb.toString().c_str()); NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", (uint32_t)ipweb);
// AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %_I"),
// NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", (uint32_t)ipweb);
#endif // LWIP_IPV6 = 1 #endif // LWIP_IPV6 = 1
TasmotaGlobal.rules_flag.http_init = 1; TasmotaGlobal.rules_flag.http_init = 1;
} }