Broadcast an error on EMFILE

When we hit the "maximum open files" limit, we close the listener that hit this
error. Previously we did so silently which means no one could figure out what
happened.

This commits adds a broadcast message giving a hint, but this should never
happen in a real-world situation anyway (unless you have 1000 users).

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-07-25 16:58:11 +02:00
parent 795126031b
commit dd56a3c2ba
+3
View File
@@ -69,6 +69,9 @@ void CRealListener::SockError(int iErrno) {
if (iErrno == EMFILE) {
// We have too many open fds, let's close this listening port to be able to continue
// to work, next rehash will (try to) reopen it.
CZNC::Get().Broadcast("We hit the FD limit, closing listening socket on ["
+ GetLocalIP() + " : " + CString(GetLocalPort()) + "]");
CZNC::Get().Broadcast("An admin has to rehash to reopen the listening port");
Close();
}
}