Improve webadmin's error messages

I just got this: (binding to ::1 on an ipv4-only build)
Module [webadmin] aborted: Could not bind to port 8080: No such file or directory
Module [webadmin] aborted: Could not bind to port 8080: Success


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1259 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-10-23 15:20:09 +00:00
parent 90cf81e686
commit 680127165a

View File

@@ -166,9 +166,14 @@ public:
}
#endif
errno = 0;
bool b = m_pManager->ListenHost(m_uPort, "WebAdmin::Listener", m_sListenHost, bSSL, SOMAXCONN, pListenSock, 0, bIPv6);
if (!b) {
sMessage = "Could not bind to port " + CString(m_uPort) + ": " + CString(strerror(errno));
sMessage = "Could not bind to port " + CString(m_uPort);
if (!m_sListenHost.empty())
sMessage += " on vhost [" + m_sListenHost + "]";
if (errno != 0)
sMessage += ": " + CString(strerror(errno));
}
return b;
}