mirror of
https://gitlab.com/chrony/chrony.git
synced 2026-01-20 21:00:20 -05:00
clientlog: refactor client record and API
Refactor the client record and clientlog API to reuse more code between different services and enumerate the services instead of hardcoding NTP and cmdmon.
This commit is contained in:
@@ -209,8 +209,8 @@ accept_connection(int server_fd, int event, void *arg)
|
||||
}
|
||||
|
||||
SCH_GetLastEventTime(&now, NULL, NULL);
|
||||
log_index = CLG_LogNTPAccess(&addr.ip_addr, &now);
|
||||
if (log_index >= 0 && CLG_LimitNTPResponseRate(log_index)) {
|
||||
log_index = CLG_LogServiceAccess(CLG_NTP, &addr.ip_addr, &now);
|
||||
if (log_index >= 0 && CLG_LimitServiceRate(CLG_NTP, log_index)) {
|
||||
DEBUG_LOG("Rejected connection from %s (%s)",
|
||||
UTI_IPSockAddrToString(&addr), "rate limit");
|
||||
SCK_CloseSocket(sock_fd);
|
||||
|
||||
Reference in New Issue
Block a user