Fix epoll dispatch dropping INotify events, ConsoleServer self-deadlock, and add TLS SNI support

- INotify/Thread epoll dispatch was silently dropping every live
  core::INotify event (an isKnownINotify registry fixes it) - this had
  broken mail delivery for over a week, masked by routine restarts.
- TCPServer::lock self-deadlocked every admin-console connection via a
  plain std::mutex being re-entered; switched to recursive_mutex.
- TLS.cpp/h: SNI-based certificate selection (addSNIContext), the
  groundwork for multi-tenant TLS (qualityiron.vegas alongside
  barant.com on one APIServer process).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Brad ArantandClaude Sonnet 5 committed 2026-10-06 17:38:37 +00:00
1 parent d058322cc6
commit 1d3d30cd05
8 files changed
+222 -55

No files matched your search

+15
View File
@@ -1,6 +1,7 @@
#include "Thread.h"
#include "EPoll.h"
#include "TCPServer.h"
#include "INotify.h"
#include <sys/epoll.h>
namespace core {
@@ -153,6 +154,20 @@ namespace core {
rawSocket->shutDown = true;
delete rawSocket;
}
} else if(INotify::isKnownINotify(rawPtr)) {
// A third category of long-lived, non-TCPSession Socket -
// see INotify::isKnownINotify()'s own doc comment for the
// real, confirmed-live bug this fixes: every INotify event
// (e.g. BARANTMail's mail-queue delivery watch) previously
// fell all the way through to the "unrecognized" branch
// below and was silently dropped forever.
Socket *rawSocket = (Socket *)rawPtr;
if(rawSocket->eventReceived(events[ix], ++ePoll.eventId)) {
// keep alive
} else {
rawSocket->shutDown = true;
delete rawSocket;
}
} else {
// Neither registry recognizes this pointer - almost
// certainly a stale/duplicate epoll event for a