From: Willy Tarreau Date: Mon, 11 May 2026 13:31:16 +0000 (+0200) Subject: CLEANUP: flt_http_comp: remove duplicate rate limit and CPU usage checks X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=e32cc2e8058d9c55d9f3c79fa96ab03c06eeb2f6;p=haproxy.git CLEANUP: flt_http_comp: remove duplicate rate limit and CPU usage checks In comp_prepare_compress_request(), the compression rate limit and CPU usage checks were duplicated. The first set runs before selecting the algorithm, and the second set runs after. That's definitely a copy-paste issue or a patch being applied twice. Let's just drop one. --- diff --git a/include/haproxy/compression-t.h b/include/haproxy/compression-t.h index 12bf12ce5..fac475eee 100644 --- a/include/haproxy/compression-t.h +++ b/include/haproxy/compression-t.h @@ -60,7 +60,7 @@ struct comp_ctx { struct slz_stream strm; const void *direct_ptr; /* NULL or pointer to beginning of data */ int direct_len; /* length of direct_ptr if not NULL */ - struct buffer queued; /* if not NULL, data already queued */ + struct buffer queued; /* if not null, data already queued */ #elif defined(USE_ZLIB) z_stream strm; /* zlib stream */ void *zlib_deflate_state; diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 9e640f477..a35e92a1d 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -172,16 +172,6 @@ comp_prepare_compress_request(struct comp_state *st, struct stream *s, struct ht else goto fail; /* no algo selected: nothing to do */ - - /* limit compression rate */ - if (global.comp_rate_lim > 0) - if (read_freq_ctr(&global.comp_bps_in) > global.comp_rate_lim) - goto fail; - - /* limit cpu usage */ - if (th_ctx->idle_pct < compress_min_idle) - goto fail; - /* initialize compression */ if (st->comp_algo->init(&st->comp_ctx, global.tune.comp_maxlevel) < 0) goto fail;