]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: logs: clarify the check of the log range
authorWilly Tarreau <w@1wt.eu>
Wed, 20 Sep 2023 18:13:20 +0000 (20:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Sep 2023 19:38:33 +0000 (21:38 +0200)
commit4351364700fb704f57e9787ea14a91a03f5c6262
treedb1f92e1c6555555b7a95e0130e533a7e89dca79
parent61b6a4da6c3ec47b5a7ab73796ca851a2c8449bd
MINOR: logs: clarify the check of the log range

The test of the log range is not very clear, in part due to the
reuse of the "curr_idx" name that happens at two levels. The call
to in_smp_log_range() applies to the smp_info's index to which 1 is
added: it verifies that the next index is still within the current
range.

Let's just have a local variable "next_index" in process_send_log()
that gets assigned the next index (current+1) and compare it to the
current range's boundaries. This makes the test much clearer. We can
then simply remove in_smp_log_range() that's no longer needed.
include/haproxy/log.h
src/log.c