Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit valid YAML for cachemgr:server_list #1735

Open
wants to merge 140 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
71ae5e0
Use PackableStream for dump_peers
kinkie Mar 13, 2024
57d511e
Fix formatting
kinkie Mar 13, 2024
8441c91
Source maintenance
kinkie Mar 14, 2024
b411cee
dump_peer_options -> CachePeer::dumpOptions
kinkie Mar 14, 2024
5a46e40
neighborTypeStr -> CachePeer::typeString
kinkie Mar 14, 2024
cd395c9
dump_peers internals -> CachePeer::reportStatistics
kinkie Mar 14, 2024
0533486
Source maintenance
kinkie Mar 14, 2024
d99bc9e
fix typo
kinkie Mar 14, 2024
d0e4b1b
Move newline at end of CachePeer::dumpOptions to callers
kinkie Mar 14, 2024
321a664
move opening newline in reportStatistics()
kinkie Mar 14, 2024
40d7295
Reposition newline
kinkie Mar 14, 2024
aec3b06
Apply suggestions from code review
kinkie Mar 15, 2024
f1e5848
fix const
kinkie Mar 15, 2024
50959d5
Do not consider current configuration to output stats
kinkie Mar 15, 2024
5486566
Reorder CachePeer::typeString position
kinkie Mar 15, 2024
cc0587d
Steamline output
kinkie Mar 15, 2024
58759f6
Move away from all caps
kinkie Mar 15, 2024
0513961
Simplified htcp options output
kinkie Mar 15, 2024
29cc51d
ESI: Disable by default (#1728)
yadij Mar 13, 2024
1bd2839
Maintenance: update --with-expat detection (#1726)
yadij Mar 13, 2024
add5c37
Maintenance: update --with-xml2 detection (#1727)
yadij Mar 15, 2024
8c60968
Convert hostname_aliases to SBufList (#1737)
yadij Mar 15, 2024
6621681
Convert loadable_modules to SBufList (#1738)
yadij Mar 15, 2024
d438cbd
Docs: Update CREDITS after code removals (#1741)
yadij Mar 16, 2024
f017aa6
Maintenance: update --with-ldap detection (#1736)
yadij Mar 17, 2024
5549d49
NoNewGlobals: HttpUpgradeProtocolAccess::ProtoOther (#1745)
kinkie Mar 19, 2024
bf6d60d
Maintenance: rework SASL detection (#1694)
kinkie Mar 20, 2024
1c86e94
NoNewGlobals for digestFieldsLookupTable (#1743)
kinkie Mar 20, 2024
cc0af08
NoNewGlobals for MapLabel (#1746)
kinkie Mar 21, 2024
077739a
Make BodyPipe::MaxCapacity constexpr (#1748)
kinkie Mar 21, 2024
cf26d14
HTTP: Protect just-parsed responses from accidental destruction (#1752)
eduard-bagdasaryan Mar 23, 2024
5846e46
Maintenance: Updated CONTRIBUTORS (#1758)
rousskov Mar 25, 2024
75f6f90
Source Format Enforcement (#1759)
rousskov Mar 26, 2024
5a1d721
Refactor portions of getCurrentTime() to use std::chrono (#1755)
yadij Mar 26, 2024
d041311
CI: Require source-maintenance.sh application before merging PRs (#1760)
rousskov Mar 27, 2024
1f63940
NoNewGlobals for Adaptation::Config::metaHeaders (#1747)
kinkie Mar 28, 2024
9caa73c
Bug 5360: FwdState::noteDestinationsEnd() assertion "err" (#1767)
rousskov Apr 1, 2024
2da7be6
scripts/find-alive.pl: Auto-detect auto-added ctors/dtors names (#1769)
rousskov Apr 1, 2024
5d18dc5
Fix heap buffer overead in ConfigParser::UnQuote() (#1763)
xiaoxiaoafeifei Apr 2, 2024
58dc0c2
Do not blame cache_peer for CONNECT errors (#1772)
rousskov Apr 2, 2024
820fea5
Fix const-correctness of ACLHTTPHeaderData::match() parameter (#1771)
rousskov Apr 3, 2024
821dfa0
Fix eCAP header includes (#1753)
yadij Apr 5, 2024
ab47a24
Maintenance: Remove several unused files (#1773)
yadij Apr 5, 2024
ac9be5a
Have SQUID_CHECK_LIB_WORKS do state SAVE/RESTORE (#1774)
yadij Apr 7, 2024
2429915
NoNewGlobals for MemBlob::Stats (#1749)
kinkie Apr 7, 2024
f3c04a9
Refactor and improve ErrorState::Dump (#1730)
kinkie Apr 8, 2024
1259975
Add AtMostOnce stream manipulator (#1742)
kinkie Apr 8, 2024
5f4a399
NoNewGlobals for HttpHdrCc:ccLookupTable (#1750)
kinkie Apr 8, 2024
604cd65
Start using YAML for output
kinkie Apr 9, 2024
72817a0
Emit valid YAML
kinkie Apr 9, 2024
3a42f6a
ESI: Disable by default (#1728)
yadij Mar 13, 2024
4220d5b
Maintenance: update --with-expat detection (#1726)
yadij Mar 13, 2024
1ceadc3
Maintenance: update --with-xml2 detection (#1727)
yadij Mar 15, 2024
82bb087
Maintenance: update --with-ldap detection (#1736)
yadij Mar 17, 2024
bd6ebd7
Maintenance: rework SASL detection (#1694)
kinkie Mar 20, 2024
0961747
Have SQUID_CHECK_LIB_WORKS do state SAVE/RESTORE (#1774)
yadij Apr 7, 2024
bda0dde
Merge remote-tracking branch 'upstream/master' into packablestream-du…
kinkie Apr 9, 2024
9fddf43
Source format
kinkie Apr 9, 2024
9f8b603
do not set FP precision on ICP counts
kinkie Apr 9, 2024
76e9b04
Do not capitalize CachePeer::typeString
kinkie Apr 9, 2024
3b7ec1d
Fix addresses
kinkie Apr 9, 2024
3a21504
Make output a map, rename stream to yaml
kinkie Apr 10, 2024
9f07570
Add sbuf/Spaces.h
kinkie Apr 10, 2024
2448b34
Souce maintenance
kinkie Apr 10, 2024
94edad0
Implement and use spaces() in YAML output
kinkie Apr 10, 2024
a777f8a
Do not report default connection-auh=auto
kinkie Apr 11, 2024
3351a20
Formatting change
kinkie Apr 11, 2024
8300fe7
rename stream back
kinkie Apr 11, 2024
32da730
Upgrade Acl::Node::name to SBuf; remove AclMatchedName global (#1766)
rousskov Apr 8, 2024
19905ac
Maintenance: update --with-tdb detection (#1776)
yadij Apr 9, 2024
5f5351c
add AsList::quotedBy()
kinkie Apr 11, 2024
add11ab
Make AsList data members private
kinkie Apr 11, 2024
85ca4d8
add default quote character; rename quotedBy to quoted
kinkie Apr 11, 2024
1a71ac4
fixup: Polished new method description
rousskov Apr 11, 2024
a2c83f7
fixup: We do not return stream from modern print() methods
rousskov Apr 11, 2024
3a29fdd
fixup: Fix official operator "<<" declaration inconsistency
rousskov Apr 11, 2024
ed07caa
fixup: Do not abuse empty strings to disable printing
rousskov Apr 11, 2024
256c9bd
fixup: Improved formatting of modified code
rousskov Apr 11, 2024
0833859
fixup: Undo out-of-scope controversial member visibility change
rousskov Apr 11, 2024
7524293
fixup: Removed the last two stale quotedBy() occurrences
rousskov Apr 11, 2024
cc51eba
fixup: Fixed my comment spelling mistake
rousskov Apr 11, 2024
f35d5d8
Merge remote-tracking branch 'upstream/master' into packablestream-du…
kinkie Apr 12, 2024
ec92b7b
neighbors.cc: ostream os -> yaml
kinkie Apr 12, 2024
39ddf88
fix wrongly named ostream
kinkie Apr 12, 2024
c4274d8
add missing header in Spaces.cc
kinkie Apr 12, 2024
62c5a3a
Add "icp" prefix for icp opcodes
kinkie Apr 12, 2024
1d10221
use aslist.quoted() for addresses list
kinkie Apr 12, 2024
4798ca0
use list instead of map for peers
kinkie Apr 12, 2024
38d2505
Fix output when there are no peers configured
kinkie Apr 12, 2024
781cc65
flags -> options
kinkie Apr 12, 2024
cc15427
separate http and icp addresses
kinkie Apr 12, 2024
6e0c391
use equality test
kinkie Apr 12, 2024
49eb09e
fix formatting
kinkie Apr 13, 2024
2886965
Merge branch 'master' into packablestream-dump_peers
kinkie Apr 13, 2024
648f7a9
Make CachePeer::reportStatistics const
kinkie Apr 14, 2024
5552cca
remove "icp " prefix for ICP opcodes output
kinkie Apr 14, 2024
eff7ce7
capitalize protocol names in output
kinkie Apr 16, 2024
bf1721c
simplify address output iteration
kinkie Apr 16, 2024
e5f2cc0
std::vector must have a non-const, non-volatile value_type
kinkie Apr 16, 2024
3dbe088
add missing spaces, quote name
kinkie Apr 17, 2024
6756fdd
use application/yaml content-type
kinkie May 1, 2024
055d5b4
Bug 5352: Do not get stuck when RESPMOD is slower than read(2) (#1777)
rousskov Apr 13, 2024
cd0df03
NoNewGlobals for cache_mem_map (#1781)
kinkie Apr 16, 2024
6a82c3c
CI: Update GitHub actions/checkout to v4 (#1786)
kinkie Apr 18, 2024
89e1fd4
Format mgr:pconn as YAML (#1780)
kinkie Apr 18, 2024
9b687a9
NoNewGlobals for ProxyProtocol::*::Magic (#1791)
kinkie Apr 26, 2024
e3df547
Add MacOS to Github Actions CI tests (#1785)
kinkie Apr 29, 2024
fef39e1
Optimization: DiskThreadsDiskFile::readDone copied request ptr (#1798)
kinkie Apr 30, 2024
9ac4f59
Optimization: DelayId::compositePosition() copied position ptr (#1799)
kinkie Apr 30, 2024
8d87059
Optimization: DelayUser::Id constructor copied user pointers (#1800)
kinkie May 1, 2024
bb7b7a7
Optimization: clientBeginRequest() call copied streamData ptr (#1797)
kinkie May 1, 2024
9f52635
Optimization: Fs::Ufs::RebuildState constructor copied dir ptr (#1802)
kinkie May 1, 2024
0ee8e5a
Optimization: esiChoose constructor call copied parent pointer (#1803)
kinkie May 1, 2024
7c91d7c
CI: better parallelism for functionality-test build (#1805)
kinkie May 1, 2024
a9a75f9
Optimization: clientStreamInit() copied ClientStreamData (#1801)
kinkie May 2, 2024
94667af
Bug 5322: Do not leak HttpReply when checking http_reply_access (#1764)
rousskov May 3, 2024
1262e4c
Maintenance: No ptr copy in future CredentialsCache::insert()s (#1807)
kinkie May 5, 2024
f409314
CI: Build layers independently to speed up GitHub Actions tests (#1787)
kinkie May 5, 2024
15cd2b0
CI: Add clang to GitHub Actions build-tests matrix (#1812)
kinkie May 14, 2024
33fbd13
Ensure ACLChecklist::markFinished() is called (#1809)
eduard-bagdasaryan May 15, 2024
6366db1
Fix build with clang v18 [-Wvla-cxx-extension] (#1813)
kinkie May 19, 2024
b5634cf
Docs: REQUIRED in ident_regex, proxy_auth_regex, ext_user_regex (#1818)
rousskov May 20, 2024
5c0e9cb
testRandomUuid: use cppunit exception tests (#1814)
kinkie May 22, 2024
838fe55
testCacheManager: use cppunit exception tests (#1811)
kinkie May 22, 2024
586deea
testHttpRange: use cppunit framework (#1816)
kinkie May 23, 2024
a442dd2
MinGW: fix error: cannot convert 'size_t*' to 'int*' (#1822)
yadij May 27, 2024
3aa043e
MinGW: Fix error: cannot convert 'const int*' to 'const char*' (#1824)
yadij May 29, 2024
e92f60e
annotate_client and annotate_transaction ACLs must always match (#1820)
eduard-bagdasaryan May 30, 2024
0250a81
MinGW: Fix error: cannot convert 'size_t*' to 'int*' (#1825)
yadij Jun 1, 2024
361e3af
Remove Ident protocol support (#1827)
eduard-bagdasaryan Jun 2, 2024
beacb50
Bug 5378: type mismatch in libTrie (#1830)
kinkie Jun 2, 2024
a3364af
Improve ErrorState debugging (#1768)
rousskov Jun 5, 2024
1078d2c
Do not die when parsing obsolete log_access and log_icap (#1832)
rousskov Jun 6, 2024
1d7b5e1
Maintenance: Remove debug_log wrapper (#1833)
yadij Jun 6, 2024
91ab954
Allocate fast-checking ACLFilledChecklists on stack (#1835)
eduard-bagdasaryan Jun 7, 2024
10045b2
mkrelease: allow two digits for minor release numbers (#1837)
kinkie Jun 9, 2024
2125983
Fix reporting of unrecognized directives (#1841)
rousskov Jun 14, 2024
7e15c2f
Fix SMP mgr:userhash, mgr:sourcehash, and mgr:carp reports (#1844)
rousskov Jun 21, 2024
a869ae2
fix merge issues
kinkie Jun 22, 2024
449f63c
Merge remote-tracking branch 'upstream/master' into packablestream-du…
kinkie Jun 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 204 additions & 1 deletion src/CachePeer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include "squid.h"
#include "acl/Gadgets.h"
#include "base/EnumIterator.h"
#include "base/IoManip.h"
#include "CachePeer.h"
#include "defines.h"
#include "neighbors.h"
Expand All @@ -16,6 +18,7 @@
#include "PeerDigest.h"
#include "PeerPoolMgr.h"
#include "SquidConfig.h"
#include "SquidMath.h"
#include "util.h"

CBDATA_CLASS_INIT(CachePeer);
Expand Down Expand Up @@ -85,7 +88,7 @@ CachePeer::noteFailure()

if (consideredAliveByAdmin) {
if (!tcp_up) {
debugs(15, DBG_IMPORTANT, "Detected DEAD " << neighborTypeStr(this) << ": " << name);
debugs(15, DBG_IMPORTANT, "Detected DEAD " << typeString() << ": " << name);
stats.logged_state = PEER_DEAD;
} else {
debugs(15, 2, "additional failures needed to mark this cache_peer DEAD: " << tcp_up);
Expand Down Expand Up @@ -114,6 +117,206 @@ CachePeer::connectTimeout() const
return Config.Timeout.peer_connect;
}

void
CachePeer::dumpOptions(std::ostream &yaml) const
kinkie marked this conversation as resolved.
Show resolved Hide resolved
{
if (options.proxy_only)
yaml << " proxy-only";

if (options.no_query)
yaml << " no-query";

if (options.background_ping)
yaml << " background-ping";

if (options.no_digest)
yaml << " no-digest";

if (options.default_parent)
yaml << " default";

if (options.roundrobin)
yaml << " round-robin";

if (options.carp)
yaml << " carp";

#if USE_AUTH
if (options.userhash)
yaml << " userhash";
#endif

if (options.sourcehash)
yaml << " sourcehash";

if (options.weighted_roundrobin)
yaml << " weighted-round-robin";

if (options.mcast_responder)
yaml << " multicast-responder";

#if PEER_MULTICAST_SIBLINGS
if (options.mcast_siblings)
yaml << " multicast-siblings";
#endif

if (weight != 1)
yaml << " weight=" << weight;

if (options.closest_only)
yaml << " closest-only";

#if USE_HTCP
if (options.htcp)
{
std::vector<const char *> opts {};
if (options.htcp_oldsquid)
opts.push_back("oldsquid");
if (options.htcp_no_clr)
opts.push_back("no-clr");
if (options.htcp_no_purge_clr)
opts.push_back("no-purge-clr");
if (options.htcp_only_clr)
opts.push_back("only-clr");
yaml << AsList(opts).prefixedBy(" htcp=").delimitedBy(",");
}
#endif

if (options.no_netdb_exchange)
yaml << " no-netdb-exchange";

#if USE_DELAY_POOLS
if (options.no_delay)
yaml << " no-delay";
#endif

if (login)
yaml << " login=" << login;

if (mcast.ttl > 0)
yaml << " ttl=" << mcast.ttl;

if (connect_timeout_raw > 0)
yaml << " connect-timeout=" << connect_timeout_raw;

if (connect_fail_limit != PEER_TCP_MAGIC_COUNT)
yaml << " connect-fail-limit=" << connect_fail_limit;

#if USE_CACHE_DIGESTS
if (digest_url)
yaml << " digest-url=" << digest_url;
#endif

if (options.allow_miss)
yaml << " allow-miss";

if (options.no_tproxy)
yaml << " no-tproxy";

if (max_conn > 0)
yaml << " max-conn=" << max_conn;

if (standby.limit > 0)
yaml << " standby=" << standby.limit;

if (options.originserver)
yaml << " originserver";

if (domain)
yaml << " forceddomain=" << domain;

if (connection_auth == 0)
yaml << " connection-auth=off";
else if (connection_auth == 1)
yaml << " connection-auth=on";
else if (connection_auth == 2)
yaml << " connection-auth=auto";
kinkie marked this conversation as resolved.
Show resolved Hide resolved

secure.dumpCfg(yaml, "tls-");
}

void
CachePeer::reportStatistics (std::ostream& yaml)
kinkie marked this conversation as resolved.
Show resolved Hide resolved
{
yaml <<
name << ":\n" <<
" type: " << typeString() << '\n' <<
" host: " << host << '/' << http_port << '/' << icp.port << '\n';
kinkie marked this conversation as resolved.
Show resolved Hide resolved
yaml << " flags:";
kinkie marked this conversation as resolved.
Show resolved Hide resolved
dumpOptions(yaml);
yaml << '\n';

std::vector<Ip::Address> addr;
std::copy(addresses, addresses+n_addresses, std::back_inserter(addr));
yaml << " addresses: [ " << AsList(addr).prefixedBy("\"").delimitedBy("\", \"").suffixedBy("\"") << " ]\n";
kinkie marked this conversation as resolved.
Show resolved Hide resolved

yaml << " status: " << (neighborUp(this) ? "Up" : "Down") << '\n' <<
" fetches: " << stats.fetches << '\n' <<
" open connections: " << stats.conn_open << '\n' <<
" average RTT: " << stats.rtt << " msec\n";

if (stats.last_query > 0) {
yaml << " last query:" <<
(squid_curtime - stats.last_query) << " seconds ago\n";
rousskov marked this conversation as resolved.
Show resolved Hide resolved
}

if (stats.last_reply > 0) {
yaml << " last reply: " <<
(squid_curtime - stats.last_reply) << " seconds ago\n";
}

yaml << " pings sent: " << stats.pings_sent << '\n' <<
" pings acked: " << stats.pings_acked << " " <<
Math::intPercent(stats.pings_acked, stats.pings_sent) << "%\n";

yaml << " replies ignored: " << stats.ignored_replies << " " <<
Math::intPercent(stats.ignored_replies, stats.pings_acked) << "%\n";

auto sectionHeader = AtMostOnce(" histogram of pings acked:\n");

#if USE_HTCP
if (options.htcp) {
yaml << sectionHeader;
yaml << " htcp misses: " << htcp.counts[0] << " " << Math::intPercent(htcp.counts[0], stats.pings_acked) << "%\n"
<< " htcp hits: " << htcp.counts[1] << " " << Math::intPercent(htcp.counts[1], stats.pings_acked) << "%\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are making this formally YAML. These two values should be separated and the line use set-brackets to bind them as a pair.

Suggested change
yaml << " htcp misses: " << htcp.counts[0] << " " << Math::intPercent(htcp.counts[0], stats.pings_acked) << "%\n"
<< " htcp hits: " << htcp.counts[1] << " " << Math::intPercent(htcp.counts[1], stats.pings_acked) << "%\n";
yaml << " htcp misses: { count: " << htcp.counts[0] << ", ratio: " << Math::intPercent(htcp.counts[0], stats.pings_acked) << "% }\n"
<< " htcp hits: { count: " << htcp.counts[1] << ", ratio: " << Math::intPercent(htcp.counts[1], stats.pings_acked) << "% }\n";

... same for the equivalent ICP lines below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. or the whole thing could be considered as a string from yaml's perspective. I'm fine either way, do you have any strong preference?

Copy link
Contributor

@rousskov rousskov Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two values should be separated and the line use set-brackets to bind them as a pair.

I am not against the change described above. FWIW, I said nothing about this in my review because it is not clear to me where to draw the line: Many other places in this output use a single YAML value for what is actually a "compound" value. Ideally, from a machine (i.e. non-human) consumer point of view, even "0 msec" should be converted to avoid post-YAML parsing. We can convert all of these values, but that is quite a bit of work and will reduce output readability for human consumers.

FWIW, if we start converting these things, I will request the removal of the corresponding code duplication like the one in the suggested replacement. Again, that is not a showstopper, it can be done, and it will improve this code quality, but keep that additional work in mind when deciding where to draw the line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep with my prior assessment and not convert, favouring humans.
If we really wanted to target machine consumers, we should probably be looking into supporting Prometheus' native format

} else {
#endif
for (auto op : WholeEnum<icp_opcode>()) {
if (icp.counts[op] == 0)
continue;

yaml << sectionHeader;
yaml << " " <<
std::right << icp_opcode_str[op] << ": " <<
kinkie marked this conversation as resolved.
Show resolved Hide resolved
icp.counts[op] << " " <<
Math::intPercent(icp.counts[op], stats.pings_acked) << "%\n";
}
#if USE_HTCP
}
#endif

if (stats.last_connect_failure) {
yaml << " last failed connection at: " <<
Time::FormatHttpd(stats.last_connect_failure) << '\n';
}

yaml << " keep-alive ratio: " <<
Math::intPercent(stats.n_keepalives_recv, stats.n_keepalives_sent) << "%\n";

}

const char *
CachePeer::typeString() const
{
static const char *typeNames[] {
"non-peer",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a "non-peer" CachePeer? I do not think those things exist in current code. If this PR has reasons to change these strings, then let's do this instead:

Suggested change
"non-peer",
"unknown",

P.S. I am also OK with replacing typeString() in various debugs() messages modified in this PR with cache_peer to avoid questions of this "non-peer" or "unknown" string escaping into contexts where it does not "fit". The rationale for reporting the peer type in those contexts is rather weak AFAICT. I do not insist on such debugs() changes though.

"sibling",
"parent",
"multicast group"
};
return typeNames[type];
}

std::ostream &
operator <<(std::ostream &os, const CachePeer &p)
{
Expand Down
9 changes: 9 additions & 0 deletions src/CachePeer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ class CachePeer
/// \returns the effective connect timeout for the given peer
time_t connectTimeout() const;

/// output to stream a representation of the peer's statistics
void reportStatistics (std::ostream& s);
kinkie marked this conversation as resolved.
Show resolved Hide resolved

/// output to stream a representation of the peer's configuration options
void dumpOptions(std::ostream &) const;

/// return a c-string representation of the peer's type
const char *typeString() const;

/// n-th cache_peer directive, starting with 1
u_int index = 0;

Expand Down
6 changes: 4 additions & 2 deletions src/cache_cf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2093,11 +2093,13 @@ dump_peer(StoreEntry * entry, const char *name, const CachePeers *peers)
storeAppendPrintf(entry, "%s %s %s %d %d name=%s",
name,
p->host,
neighborTypeStr(p),
p->typeString(),
p->http_port,
p->icp.port,
p->name);
dump_peer_options(entry, p);
PackableStream s(*entry);
p->dumpOptions(s);
s << "\n";

if (p->access) {
snprintf(xname, 128, "cache_peer_access %s", p->name);
Expand Down
2 changes: 1 addition & 1 deletion src/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum fd_type {
};

typedef enum {
PEER_NONE,
PEER_NONE = 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ guarantees that, right? If yes, we do not want to start adjusting various enums to duplicate that guarantee, especially in a PR focusing on YAML conversion.

Suggested change
PEER_NONE = 0,
PEER_NONE,

PEER_SIBLING,
PEER_PARENT,
PEER_MULTICAST
Expand Down
Loading
Loading