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:
psychon
2008-04-16 19:46:26 +00:00
parent 51dd3e2b32
commit 5f293039b5
+20 -2
View File
@@ -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();