]> git.ipfire.org Git - thirdparty/squid.git/blob - src/CachePeer.cc
Maintenance: Update astyle version to 3.1 (#841)
[thirdparty/squid.git] / src / CachePeer.cc
1 /*
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #include "squid.h"
10 #include "acl/Gadgets.h"
11 #include "CachePeer.h"
12 #include "defines.h"
13 #include "NeighborTypeDomainList.h"
14 #include "pconn.h"
15 #include "PeerPoolMgr.h"
16 #include "SquidConfig.h"
17
18 CBDATA_CLASS_INIT(CachePeer);
19
20 CachePeer::~CachePeer()
21 {
22 xfree(name);
23 xfree(host);
24
25 while (NeighborTypeDomainList *l = typelist) {
26 typelist = l->next;
27 xfree(l->domain);
28 xfree(l);
29 }
30
31 aclDestroyAccessList(&access);
32
33 #if USE_CACHE_DIGESTS
34 cbdataReferenceDone(digest);
35 xfree(digest_url);
36 #endif
37
38 delete next;
39
40 xfree(login);
41
42 delete standby.pool;
43
44 // the mgr job will notice that its owner is gone and stop
45 PeerPoolMgr::Checkpoint(standby.mgr, "peer gone");
46
47 xfree(domain);
48 }
49
50 time_t
51 CachePeer::connectTimeout() const
52 {
53 if (connect_timeout_raw > 0)
54 return connect_timeout_raw;
55 return Config.Timeout.peer_connect;
56 }
57