mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 11:25:06 -05:00
nts: scale server listening backlog with number of helpers
This commit is contained in:
@@ -277,8 +277,8 @@ static int
|
||||
open_socket(int family)
|
||||
{
|
||||
IPSockAddr local_addr;
|
||||
int backlog, sock_fd;
|
||||
char *iface;
|
||||
int sock_fd;
|
||||
|
||||
if (!SCK_IsIpFamilyEnabled(family))
|
||||
return INVALID_SOCK_FD;
|
||||
@@ -293,7 +293,11 @@ open_socket(int family)
|
||||
return INVALID_SOCK_FD;
|
||||
}
|
||||
|
||||
if (!SCK_ListenOnSocket(sock_fd, CNF_GetNtsServerConnections())) {
|
||||
/* Set the maximum number of waiting connections on the socket to the maximum
|
||||
number of concurrent sessions */
|
||||
backlog = MAX(CNF_GetNtsServerProcesses(), 1) * CNF_GetNtsServerConnections();
|
||||
|
||||
if (!SCK_ListenOnSocket(sock_fd, backlog)) {
|
||||
SCK_CloseSocket(sock_fd);
|
||||
return INVALID_SOCK_FD;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user