BUG/MINOR: sample: Fix sample to retrieve the number of bytes received and sent

There was an issue in the if/else statement in smp_fetch_bytes() function.
When req.bytes_in or req.bytes_out was requested, res.bytes_in was always
returned. It is now fixed.

This patch must be backported to 3.3.
This commit is contained in:
Christopher Faulet 2026-03-05 09:58:59 +01:00
parent e0728ebcf4
commit 4791501011

View File

@ -5543,7 +5543,7 @@ static int smp_fetch_bytes(const struct arg *args, struct sample *smp, const cha
if (kw[2] == 'q') /* req.bytes_in or req.bytes_out */
smp->data.u.sint = (kw[10] == 'i') ? logs->req_in : logs->req_out;
if (kw[2] == 's') /* res.bytes_in or res.bytes_out */
else if (kw[2] == 's') /* res.bytes_in or res.bytes_out */
smp->data.u.sint = (kw[10] == 'i') ? logs->res_in : logs->res_out;
else /* bytes_in or bytes_out */
smp->data.u.sint = (kw[6] == 'i') ? logs->req_in : logs->res_in;