diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index fcfa027c..5f81f6d9 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -1994,8 +1994,8 @@ class CWebAdminMod : public CModule { } #endif -#ifdef HAVE_IPV6 if (pTCPListener != nullptr) { +#ifdef HAVE_IPV6 switch (pTCPListener->GetAddrType()) { case ADDR_IPV4ONLY: l["IsIPV4"] = "true"; @@ -2008,12 +2008,10 @@ class CWebAdminMod : public CModule { l["IsIPV6"] = "true"; break; } - } #else - if (pTCPListener != nullptr) { l["IsIPV4"] = "true"; - } #endif + } } vector vDirs; diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index a681294e..1cae443a 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -1636,18 +1636,14 @@ void CClient::UserPortCommand(CString& sLine) { for (const CListener* pListener : vpListeners) { Table.AddRow(); - const CTCPListener* pTCPListener = - dynamic_cast(pListener); - if (pTCPListener != nullptr) { + if (const CTCPListener* pTCPListener = + dynamic_cast(pListener)) { Table.SetCell(t_s("Port", "listports"), CString(pTCPListener->GetPort())); Table.SetCell(t_s("BindHost", "listports"), (pTCPListener->GetBindHost().empty() ? CString("*") : pTCPListener->GetBindHost())); - Table.SetCell(t_s("SSL", "listports"), - pListener->IsSSL() ? t_s("yes", "listports|ssl") - : t_s("no", "listports|ssl")); EAddrType eAddr = pTCPListener->GetAddrType(); Table.SetCell( @@ -1656,10 +1652,14 @@ void CClient::UserPortCommand(CString& sLine) { ? t_s("IPv4 and IPv6", "listports") : (eAddr == ADDR_IPV4ONLY ? t_s("IPv4", "listports") : t_s("IPv6", "listports"))); - } else { - // TODO: Handle CUnixListener - Table.SetCell("Port", "unknown"); + } else if (const CUnixListener* pUnixListener = + dynamic_cast(pListener)) { + Table.SetCell(t_s("BindHost", "listports"), + pUnixListener->GetPath()); } + Table.SetCell(t_s("SSL", "listports"), + pListener->IsSSL() ? t_s("yes", "listports|ssl") + : t_s("no", "listports|ssl")); CListener::EAcceptType eAccept = pListener->GetAcceptType(); Table.SetCell(t_s("IRC", "listports"),