Hi,
In function parse_peer(), the ICP peers configured in squid.conf will
be
added to callback data hash table by
cbdataAdd(p, peerDestroy, MEM_PEER);
In function peerAddFwdServer()
cbdataLock(fs->peer);
locks the peer which presumably comes from the global ICP peers list.
In function fwdServerFree(), function cbdataUnlock() will be called to
unlock this peer.
I think the peers are preconfigured and global to all
requests/clients. So we should never free them up (until squid
shutdown). So, what's the point of having these lock and unlock stuff?
BTW, this cbdataLock() actually does not free the peers because the
valid field is set to 1 in cbdataAdd() but nobody set it back to 0
except cbdataFree() which never gets called for the peers (I mean, at
least I couldn't find the code).
-- ChengduReceived on Sat Apr 12 2003 - 15:55:09 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:41 MST