From: Christopher Faulet Date: Thu, 26 Jan 2023 15:11:02 +0000 (+0100) Subject: MINOR: bwlim: Remove useless test on CF_READ_ERROR to detect the last packet X-Git-Tag: v2.8-dev4~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3ef9c392e9487eca373366f265c2b86f4d3f30b;p=thirdparty%2Fhaproxy.git MINOR: bwlim: Remove useless test on CF_READ_ERROR to detect the last packet There is already a test on CF_EOI and CF_SHUTR. The last one is always set when a read error is reported. Thus there is no reason to check CF_READ_ERROR. --- diff --git a/src/flt_bwlim.c b/src/flt_bwlim.c index 136be5c2d6..20919fcd1e 100644 --- a/src/flt_bwlim.c +++ b/src/flt_bwlim.c @@ -151,7 +151,7 @@ static int bwlim_apply_limit(struct filter *filter, struct channel *chn, unsigne */ ret = tokens; if (tokens < conf->min_size) { - ret = (chn->flags & (CF_EOI|CF_SHUTR|CF_READ_ERROR)) + ret = (chn->flags & (CF_EOI|CF_SHUTR)) ? MIN(len, conf->min_size) : conf->min_size;