clientlog: return enum from CLG_LimitServiceRate()

Change CLG_LimitServiceRate() to return an enum in preparation for
adding KoD RATE support.
This commit is contained in:
Miroslav Lichvar
2024-04-02 11:37:39 +02:00
parent ce956c99a8
commit c8c7f518b1
6 changed files with 20 additions and 12 deletions

View File

@@ -1511,9 +1511,10 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
/* Don't reply to all requests from hosts other than localhost if the rate
is excessive */
if (!localhost && log_index >= 0 && CLG_LimitServiceRate(CLG_CMDMON, log_index)) {
DEBUG_LOG("Command packet discarded to limit response rate");
return;
if (!localhost && log_index >= 0 &&
CLG_LimitServiceRate(CLG_CMDMON, log_index) != CLG_PASS) {
DEBUG_LOG("Command packet discarded to limit response rate");
return;
}
expected_length = PKL_CommandLength(&rx_message);