From cbea31dd64a9a482b57f0b4500c8375efaa81bd4 Mon Sep 17 00:00:00 2001 From: hwware Date: Fri, 11 Oct 2024 20:01:37 +0000 Subject: [PATCH] update format and event loop size based on the max admin port clients Signed-off-by: hwware --- src/networking.c | 4 ++-- src/server.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/networking.c b/src/networking.c index d1c93447ae..20e4937302 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1409,9 +1409,9 @@ void acceptCommonHandler(connection *conn, struct ClientFlags flags, char *ip) { } if (port == server.admin_port && (connIsLocal(conn) != 1 || - (listLength(server.clients) + getClusterConnectionsCount() >= server.maxclients + MAX_ADMIN_CLIENTS))) { + (listLength(server.clients) + getClusterConnectionsCount() >= server.maxclients + MAX_ADMIN_CLIENTS))) { serverLog(LL_WARNING, "Denied connection. Max number of clients reached on admin-port or connection is not" - " from the loopback interface."); + " from the loopback interface."); server.stat_rejected_conn++; connClose(conn); return; diff --git a/src/server.c b/src/server.c index 0f0f0770fc..2157bc8cd3 100644 --- a/src/server.c +++ b/src/server.c @@ -2631,7 +2631,7 @@ void initServer(void) { adjustOpenFilesLimit(); const char *clk_msg = monotonicInit(); serverLog(LL_NOTICE, "monotonic clock: %s", clk_msg); - server.el = aeCreateEventLoop(server.maxclients + CONFIG_FDSET_INCR); + server.el = aeCreateEventLoop(server.maxclients + MAX_ADMIN_CLIENTS + CONFIG_FDSET_INCR); if (server.el == NULL) { serverLog(LL_WARNING, "Failed creating the event loop. Error message: '%s'", strerror(errno)); exit(1);