From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Fri, 3 May 2024 23:49:30 +0000 (+0000) Subject: Report cache_peer htcp=forward-clr option (#1808) X-Git-Tag: SQUID_7_0_1~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffe9533724a49adebe7656142b9ef82b0ea053b7;p=thirdparty%2Fsquid.git Report cache_peer htcp=forward-clr option (#1808) Also simplified reporting code and addressed Coverity CID 740350: Logically dead code (DEADCODE). --- diff --git a/src/neighbors.cc b/src/neighbors.cc index 2bf088b062..63bd0fb831 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1417,25 +1417,18 @@ dump_peer_options(StoreEntry * sentry, CachePeer * p) #if USE_HTCP if (p->options.htcp) { os << " htcp"; - if (p->options.htcp_oldsquid || p->options.htcp_no_clr || p->options.htcp_no_purge_clr || p->options.htcp_only_clr) { - bool doneopts = false; - if (p->options.htcp_oldsquid) { - os << (doneopts ? ',' : '=') << "oldsquid"; - doneopts = true; - } - if (p->options.htcp_no_clr) { - os << (doneopts ? ',' : '=') << "no-clr"; - doneopts = true; - } - if (p->options.htcp_no_purge_clr) { - os << (doneopts ? ',' : '=') << "no-purge-clr"; - doneopts = true; - } - if (p->options.htcp_only_clr) { - os << (doneopts ? ',' : '=') << "only-clr"; - //doneopts = true; // uncomment if more opts are added - } - } + std::vector > opts; + if (p->options.htcp_oldsquid) + opts.push_back("oldsquid"); + if (p->options.htcp_no_clr) + opts.push_back("no-clr"); + if (p->options.htcp_no_purge_clr) + opts.push_back("no-purge-clr"); + if (p->options.htcp_only_clr) + opts.push_back("only-clr"); + if (p->options.htcp_forward_clr) + opts.push_back("forward-clr"); + os << AsList(opts).prefixedBy("=").delimitedBy(","); } #endif