mirror of
https://github.com/znc/znc.git
synced 2026-08-07 09:22:55 +02:00
Display better error messages if we can't connect to IRC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1023 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+20
-2
@@ -923,9 +923,27 @@ void CIRCSock::Disconnected() {
|
||||
}
|
||||
|
||||
void CIRCSock::SockError(int iErrno) {
|
||||
DEBUG_ONLY(cout << GetSockName() << " == SockError(" << iErrno << ")" << endl);
|
||||
CString sError;
|
||||
|
||||
if (iErrno == EDOM) {
|
||||
sError = "Your VHost could not be resolved";
|
||||
} else if (iErrno = EADDRNOTAVAIL) {
|
||||
// Csocket uses this if it can't resolve the dest host name
|
||||
sError = strerror(iErrno);
|
||||
sError += " (Is your IRC server's host name valid?)";
|
||||
} else {
|
||||
sError = strerror(iErrno);
|
||||
}
|
||||
|
||||
DEBUG_ONLY(cout << GetSockName() << " == SockError(" << iErrno << " "
|
||||
<< sError << ")" << endl);
|
||||
if (!m_pUser->IsBeingDeleted()) {
|
||||
m_pUser->PutStatus("Disconnected from IRC (" + CString(strerror(iErrno)) + "). Reconnecting...");
|
||||
if (GetConState() != CST_OK)
|
||||
m_pUser->PutStatus("Cannot connect to IRC (" +
|
||||
sError + "). Retrying...");
|
||||
else
|
||||
m_pUser->PutStatus("Disconnected from IRC (" +
|
||||
sError + "). Reconnecting...");
|
||||
}
|
||||
m_pUser->ClearRawBuffer();
|
||||
m_pUser->ClearMotdBuffer();
|
||||
|
||||
Reference in New Issue
Block a user