Skip to content

Commit

Permalink
update format and event loop size based on the max admin port clients
Browse files Browse the repository at this point in the history
Signed-off-by: hwware <[email protected]>
  • Loading branch information
hwware committed Oct 11, 2024
1 parent fe9bd71 commit cbea31d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cbea31d

Please sign in to comment.