]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: bwlim: Remove useless test on CF_READ_ERROR to detect the last packet
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 26 Jan 2023 15:11:02 +0000 (16:11 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 13 Feb 2023 08:43:38 +0000 (09:43 +0100)
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.

src/flt_bwlim.c

index 136be5c2d67b15e1241f9f108d541835094b220d..20919fcd1ef06c91c10a96aede380ee565b536f0 100644 (file)
@@ -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;