]> git.ipfire.org Git - thirdparty/squid.git/commit - src/carp.cc
Do not use raw pointers to index CARP CachePeers (#1381)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 8 Aug 2023 01:59:50 +0000 (01:59 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 8 Aug 2023 02:00:02 +0000 (02:00 +0000)
commite7959b56a56634766df84324ef8383540ae36118
tree68bdd51ce6a53d1a7357e6aa9a32389043ecf386
parenteecdbc19dea4b8e7ab1a58586eb6958982b93a32
Do not use raw pointers to index CARP CachePeers (#1381)

Simplified and improved code safety by using CbcPointers instead.

Also fixed mgr:carp Cache Manager reports to detail relevant
cache_peers instead of all cache_peers. When mgr:carp report was added
in 2000 commit 8ee9b49, Squid did not index (or even distinguish!)
CARP cache_peers, and the reporting loop naturally iterated through all
cache_peers. 2002 commit b399543 added identification and indexing of
CARP peers but forgot to adjust the reporting loop.

Very similar changes will be applied to userhash and sourcehash
cache_peers. 2008 commit 63104e2 simply copied problematic CARP code to
add userhash and sourcehash cache_peer support. This change adds a few
reusable types with those upcoming improvements in mind.
src/CachePeers.h [new file with mode: 0644]
src/Makefile.am
src/carp.cc