mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
CLEANUP: logs: rename a confusing local variable "curr_rg" to "smp_rg"
The variable curr_rg in process_send_log() is misleading because it is not related to the integer curr_rg that's used to calculate it, instead it's a pointer to the current smp_log_range from smp_rgs[], so let's call it "smp_rg" as a singular for this "smp_rgs" and put an end to this confusion.
This commit is contained in:
parent
3f1284560f
commit
49ddc0138c
@ -1829,18 +1829,18 @@ void process_send_log(struct list *logsrvs, int level, int facility,
|
||||
continue;
|
||||
|
||||
if (logsrv->lb.smp_rgs) {
|
||||
struct smp_log_range *curr_rg;
|
||||
struct smp_log_range *smp_rg;
|
||||
unsigned int next_idx;
|
||||
|
||||
HA_SPIN_LOCK(LOGSRV_LOCK, &logsrv->lock);
|
||||
next_idx = logsrv->lb.curr_idx + 1;
|
||||
curr_rg = &logsrv->lb.smp_rgs[logsrv->lb.curr_rg];
|
||||
smp_rg = &logsrv->lb.smp_rgs[logsrv->lb.curr_rg];
|
||||
|
||||
/* check if the index we're going to take is within range */
|
||||
in_range = curr_rg->low <= next_idx && next_idx <= curr_rg->high;
|
||||
in_range = smp_rg->low <= next_idx && next_idx <= smp_rg->high;
|
||||
if (in_range) {
|
||||
/* Let's consume this range. */
|
||||
if (next_idx == curr_rg->high) {
|
||||
if (next_idx == smp_rg->high) {
|
||||
/* If consumed, let's select the next range. */
|
||||
logsrv->lb.curr_rg = (logsrv->lb.curr_rg + 1) % logsrv->lb.smp_rgs_sz;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user