From dd56a3c2ba3e57c14d62618af09f75b84d696742 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 25 Jul 2011 16:58:11 +0200 Subject: [PATCH] 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 --- Listener.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Listener.cpp b/Listener.cpp index 7190cb53..5c77c6d5 100644 --- a/Listener.cpp +++ b/Listener.cpp @@ -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(); } }