mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
CSocket: Close sockets which cause a EMFILE
This now closes listening sockets if we hit some fd limit like we are already doing in CRealListener. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1544 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -137,6 +137,14 @@ void CSocket::ReachedMaxBuffer() {
|
||||
Close();
|
||||
}
|
||||
|
||||
void CSocket::SockError(int iErrno) {
|
||||
DEBUG(GetSockName() << " == SockError(" << strerror(iErrno) << ")");
|
||||
if (iErrno == EMFILE) {
|
||||
// We have too many open fds, this can cause a busy loop.
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
bool CSocket::Connect(const CString& sHostname, unsigned short uPort, bool bSSL, unsigned int uTimeout) {
|
||||
CUser* pUser = m_pModule->GetUser();
|
||||
CString sSockName = "MOD::C::" + m_pModule->GetModName();
|
||||
|
||||
Reference in New Issue
Block a user