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);