]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
renamed domain_ping to CachePeerDomainList and moved to own header file
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 22 Sep 2012 13:26:23 +0000 (15:26 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 22 Sep 2012 13:26:23 +0000 (15:26 +0200)
src/CachePeer.h
src/CachePeerDomainList.h [new file with mode: 0644]
src/Makefile.am
src/cache_cf.cc
src/neighbors.cc
src/structs.h

index 83e7505fac684435b298646f6ac2bd8f40a4610d..94067ec9e8e6ded9e06d92f2acd49fb7a795cf80 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 
 class acl_access;
-class domain_ping;
+class CachePeerDomainList;
 class NeighborTypeDomainList;
 class PeerDigest;
 
@@ -85,7 +85,7 @@ public:
 #endif
 
     unsigned short http_port;
-    domain_ping *peer_domain;
+    CachePeerDomainList *peer_domain;
     NeighborTypeDomainList *typelist;
     acl_access *access;
 
diff --git a/src/CachePeerDomainList.h b/src/CachePeerDomainList.h
new file mode 100644 (file)
index 0000000..050d0e2
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef SQUID_CACHEPEERDOMAINLIST_H_
+#define SQUID_CACHEPEERDOMAINLIST_H_
+/*
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+/// representation of the cache_peer_domain list. POD.
+class CachePeerDomainList
+{
+public:
+    char *domain;
+    bool do_ping;
+    CachePeerDomainList *next;
+};
+
+#endif /* SQUID_CACHEPEERDOMAINLIST_H_ */
index fcddd3450d79fb556439b6905542186304cc8404..7ef917f55d9b62dc658a670376730e024d59be91 100644 (file)
@@ -277,6 +277,7 @@ squid_SOURCES = \
        CacheDigest.cc \
        cache_manager.cc \
        NeighborTypeDomainList.h \
+       CachePeerDomainList.h \
        CachePeer.h \
        CacheManager.h \
        carp.h \
index a58f3602c2ad86fb611b6608a7c66c2c7b4e69aa..608541d16e55479c5d97a8b76f8b7d2eb8a418c7 100644 (file)
@@ -42,6 +42,7 @@
 #include "base/RunnersRegistry.h"
 #include "mgr/ActionPasswordList.h"
 #include "CachePeer.h"
+#include "CachePeerDomainList.h"
 #include "cache_cf.h"
 #include "ConfigParser.h"
 #include "CpuAffinityMap.h"
@@ -1976,7 +1977,7 @@ peer_type_str(const peer_t type)
 static void
 dump_peer(StoreEntry * entry, const char *name, CachePeer * p)
 {
-    domain_ping *d;
+    CachePeerDomainList *d;
     NeighborTypeDomainList *t;
     LOCAL_ARRAY(char, xname, 128);
 
@@ -2514,8 +2515,8 @@ parse_hostdomain(void)
         self_destruct();
 
     while ((domain = strtok(NULL, list_sep))) {
-        domain_ping *l = NULL;
-        domain_ping **L = NULL;
+        CachePeerDomainList *l = NULL;
+        CachePeerDomainList **L = NULL;
         CachePeer *p;
 
         if ((p = peerFindByName(host)) == NULL) {
@@ -2523,11 +2524,11 @@ parse_hostdomain(void)
             continue;
         }
 
-        l = static_cast<domain_ping *>(xcalloc(1, sizeof(domain_ping)));
-        l->do_ping = 1;
+        l = static_cast<CachePeerDomainList *>(xcalloc(1, sizeof(CachePeerDomainList)));
+        l->do_ping = true;
 
         if (*domain == '!') {  /* check for !.edu */
-            l->do_ping = 0;
+            l->do_ping = false;
             ++domain;
         }
 
index 3b0ac00d4febcaf8fc0e6d6ab487ba101ee71062..73977af2f9aa77d637d512e45f3734c815512ca9 100644 (file)
@@ -35,6 +35,7 @@
 #include "anyp/PortCfg.h"
 #include "CacheDigest.h"
 #include "CachePeer.h"
+#include "CachePeerDomainList.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
 #include "event.h"
@@ -156,7 +157,7 @@ bool
 peerAllowedToUse(const CachePeer * p, HttpRequest * request)
 {
 
-    const domain_ping *d = NULL;
+    const CachePeerDomainList *d = NULL;
     assert(request != NULL);
 
     if (neighborType(p, request) == PEER_SIBLING) {
@@ -1163,9 +1164,9 @@ peerDestroy(void *data)
     if (p == NULL)
         return;
 
-    domain_ping *nl = NULL;
+    CachePeerDomainList *nl = NULL;
 
-    for (domain_ping *l = p->peer_domain; l; l = nl) {
+    for (CachePeerDomainList *l = p->peer_domain; l; l = nl) {
         nl = l->next;
         safe_free(l->domain);
         xfree(l);
@@ -1585,7 +1586,7 @@ dump_peers(StoreEntry * sentry, CachePeer * peers)
 {
     CachePeer *e = NULL;
     char ntoabuf[MAX_IPSTRLEN];
-    domain_ping *d = NULL;
+    CachePeerDomainList *d = NULL;
     icp_opcode op;
     int i;
 
index c7879b33fbece46fb8504d185b0a6999c583079f..e9285dccf60440fa2cc81ed0beba65ac14336b65 100644 (file)
@@ -162,15 +162,6 @@ public:
     unsigned int sentLastChunk:1; ///< do not try to write last-chunk again
 };
 
-// POD
-class domain_ping
-{
-public:
-    char *domain;
-    int do_ping;               /* boolean */
-    domain_ping *next;
-};
-
 #if USE_SSL
 struct _sslproxy_cert_sign {
     int alg;