From: Amaury Denoyelle Date: Thu, 25 Feb 2021 13:46:08 +0000 (+0100) Subject: BUG/MINOR: stats: fix compare of no-maint url suffix X-Git-Tag: v2.4-dev10~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91e55ea3f3f6277d91c0fd85ea924ea0e444f7f3;p=thirdparty%2Fhaproxy.git BUG/MINOR: stats: fix compare of no-maint url suffix Only the first 3 characters are compared for ';no-maint' suffix in http_handle_stats. Fix it by doing a full match over the entire suffix. As a side effect, the ';norefresh' suffix matched the inaccurate comparison, so the maintenance servers were always hidden on the stats page in this case. no-maint suffix is present since commit 3e320367014c742814ba494594cdb8340b1161f1 MINOR: stats: also support a "no-maint" show stat modifier It should be backported up to 2.3. This fixes github issue #1147. --- diff --git a/src/http_ana.c b/src/http_ana.c index 4b74626e04..84324eb200 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -3950,7 +3950,10 @@ static int http_handle_stats(struct stream *s, struct channel *req) appctx->ctx.stats.flags |= STAT_HIDE_DOWN; break; } - if (memcmp(h, ";no-maint", 3) == 0) { + } + + for (h = lookup; h <= end - 9; h++) { + if (memcmp(h, ";no-maint", 9) == 0) { appctx->ctx.stats.flags |= STAT_HIDE_MAINT; break; }