]> jfr.im git - irc/rizon/znc.git/commitdiff
Improve webadmin's error messages
authorpsychon <redacted>
Thu, 23 Oct 2008 15:20:09 +0000 (15:20 +0000)
committerpsychon <redacted>
Thu, 23 Oct 2008 15:20:09 +0000 (15:20 +0000)
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

modules/webadmin.cpp

index 3de22f89c15461a908792a0f1531a14a046c07a8..a0de0b7b752dea055f60d9adb887162e0df62997 100644 (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;
        }