]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged from trunk
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 24 Sep 2012 19:34:52 +0000 (21:34 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 24 Sep 2012 19:34:52 +0000 (21:34 +0200)
318 files changed:
src/AccessLogEntry.cc
src/AccessLogEntry.h
src/AuthReg.h
src/CacheDigest.cc
src/CacheDigest.h
src/CacheManager.h
src/CachePeer.h [new file with mode: 0644]
src/CachePeerDomainList.h [new file with mode: 0644]
src/ConfigOption.h
src/ConfigParser.cc
src/ConfigParser.h
src/CpuAffinity.cc
src/Debug.h
src/DelayBucket.cc
src/DelayId.cc
src/DiskIO/DiskDaemon/DiskdIOStrategy.cc
src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc
src/DiskIO/DiskThreads/aiops.cc
src/DiskIO/DiskThreads/aiops_win32.cc
src/DiskIO/IpcIo/IpcIoFile.cc
src/DnsLookupDetails.h
src/ETag.h
src/EventLoop.cc
src/EventLoop.h
src/ExternalACL.h
src/ExternalACLEntry.h
src/HierarchyLogEntry.h
src/HttpHdrCc.cc
src/HttpHdrCc.h
src/HttpHdrContRange.h
src/HttpHdrRange.cc
src/HttpHdrSc.cc
src/HttpHdrSc.h
src/HttpHdrScTarget.h
src/HttpHeader.cc
src/HttpHeader.h
src/HttpHeaderFieldInfo.h [new file with mode: 0644]
src/HttpHeaderFieldStat.h [new file with mode: 0644]
src/HttpHeaderMask.h
src/HttpHeaderRange.h
src/HttpHeaderTools.cc
src/HttpHeaderTools.h
src/HttpMsg.cc
src/HttpParser.cc
src/HttpParser.h
src/HttpReply.cc
src/HttpReply.h
src/HttpRequest.cc
src/HttpRequest.h
src/HttpRequestMethod.h
src/HttpStateFlags.h [new file with mode: 0644]
src/ICP.h
src/IoStats.h [new file with mode: 0644]
src/LoadableModules.h
src/Makefile.am
src/Mem.h
src/MemObject.cc
src/MemObject.h
src/MemStore.cc
src/NeighborTypeDomainList.h [new file with mode: 0644]
src/Parsing.h
src/PeerDigest.h
src/PeerSelectState.h
src/RefreshPattern.h [new file with mode: 0644]
src/RegexList.cc [new file with mode: 0644]
src/RegexList.h [new file with mode: 0644]
src/RemovalPolicy.h
src/RequestFlags.cc [new file with mode: 0644]
src/RequestFlags.h [new file with mode: 0644]
src/Server.cc
src/Server.h
src/SnmpRequest.h [new file with mode: 0644]
src/SquidConfig.cc
src/SquidConfig.h [new file with mode: 0644]
src/SquidDns.h
src/SquidIpc.h
src/SquidList.h
src/SquidMath.h
src/SquidString.h
src/Store.cci
src/Store.h
src/StoreClient.h
src/StrList.h
src/SwapDir.cc
src/SwapDir.h
src/URL.h
src/WinSvc.h
src/YesNoNone.cc [new file with mode: 0644]
src/YesNoNone.h [new file with mode: 0644]
src/acl/Acl.cc
src/acl/Acl.h
src/acl/AclAddress.cc [new file with mode: 0644]
src/acl/AclAddress.h [new file with mode: 0644]
src/acl/AclDenyInfoList.h [new file with mode: 0644]
src/acl/AclNameList.h [new file with mode: 0644]
src/acl/Asn.cc
src/acl/Asn.h
src/acl/DestinationIp.cc
src/acl/FilledChecklist.cc
src/acl/FilledChecklist.h
src/acl/Gadgets.cc
src/acl/Gadgets.h
src/acl/Makefile.am
src/acl/MaxConnection.cc
src/acl/PeerName.cc
src/acl/RegexData.cc
src/acl/RegexData.h
src/acl/Strategised.cc
src/adaptation/AccessCheck.cc
src/adaptation/AccessRule.cc
src/adaptation/AccessRule.h
src/adaptation/Config.cc
src/adaptation/icap/Client.h
src/adaptation/icap/Config.cc
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/Xaction.cc
src/adaptation/icap/icap_log.cc
src/auth/Acl.cc
src/auth/Acl.h
src/auth/Gadgets.h
src/auth/User.cc
src/auth/UserRequest.h
src/auth/basic/User.cc
src/auth/digest/User.cc
src/auth/digest/auth_digest.cc
src/auth/digest/auth_digest.h
src/auth/negotiate/UserRequest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/UserRequest.cc
src/auth/ntlm/auth_ntlm.cc
src/base/AsyncCall.cc
src/base/AsyncCall.h
src/base/TextException.h
src/cache_cf.cc
src/cache_cf.h
src/cache_manager.cc
src/carp.cc
src/carp.h
src/cbdata.h
src/client_db.cc
src/client_db.h
src/client_side.cc
src/client_side.h
src/client_side_reply.cc
src/client_side_reply.h
src/client_side_request.cc
src/client_side_request.h
src/comm.cc
src/comm.h
src/comm/ConnOpener.cc
src/comm/Connection.cc
src/comm/Connection.h
src/comm/IoCallback.h
src/comm/Loops.h
src/comm/ModPoll.cc
src/comm/ModSelect.cc
src/comm/TcpAcceptor.cc
src/comm/comm_internal.h
src/disk.cc
src/disk.h
src/dlink.h
src/dns.cc
src/dns_internal.cc
src/enums.h
src/errorpage.cc
src/errorpage.h
src/esi/Context.h
src/esi/Esi.cc
src/esi/Esi.h
src/esi/Module.h
src/esi/Segment.h
src/esi/VarState.h
src/event.h
src/external_acl.cc
src/fd.h
src/fde.h
src/format/Format.cc
src/format/Quoting.h
src/format/Token.cc
src/forward.cc
src/forward.h
src/fqdncache.cc
src/fqdncache.h
src/fs/Module.h
src/fs/coss/CossSwapDir.h
src/fs/coss/store_dir_coss.cc
src/fs/coss/store_io_coss.cc
src/fs/rock/RockRebuild.h
src/fs/rock/RockSwapDir.cc
src/fs/ufs/RebuildState.cc
src/fs/ufs/RebuildState.h
src/fs/ufs/UFSSwapDir.cc
src/ftp.cc
src/ftp.h
src/globals.h
src/gopher.cc
src/gopher.h
src/htcp.cc
src/htcp.h
src/http.cc
src/http.h
src/icmp/Icmp.h
src/icmp/IcmpSquid.cc
src/icmp/net_db.cc
src/icmp/net_db.h
src/icp_v2.cc
src/int.h
src/internal.cc
src/internal.h
src/ip/QosConfig.h
src/ipc.cc
src/ipc/Forwarder.h
src/ipc/Kids.cc
src/ipc/mem/Pages.cc
src/ipc_win32.cc
src/ipcache.cc
src/ipcache.h
src/log/CustomLog.cc [new file with mode: 0644]
src/log/CustomLog.h [new file with mode: 0644]
src/log/FormatHttpdCombined.cc
src/log/FormatHttpdCommon.cc
src/log/FormatSquidCustom.cc
src/log/FormatSquidIcap.cc
src/log/FormatSquidNative.cc
src/log/Formats.h
src/log/Makefile.am
src/log/ModDaemon.cc
src/log/ModStdio.cc
src/log/ModTcp.cc
src/log/ModUdp.cc
src/log/access_log.cc
src/main.cc
src/mem.cc
src/mgr/ActionParams.h
src/mgr/ActionPasswordList.cc [new file with mode: 0644]
src/mgr/ActionPasswordList.h [new file with mode: 0644]
src/mgr/BasicActions.cc
src/mgr/IoAction.cc
src/mgr/IoAction.h
src/mgr/Makefile.am
src/mime.cc
src/mime.h
src/mime_header.h
src/multicast.cc
src/multicast.h
src/neighbors.cc
src/neighbors.h
src/pconn.cc
src/peer_digest.cc
src/peer_select.cc
src/peer_sourcehash.cc
src/peer_sourcehash.h
src/peer_userhash.cc
src/peer_userhash.h
src/protos.h
src/redirect.cc
src/redirect.h
src/refresh.cc
src/refresh.h
src/repl_modules.h
src/send-announce.cc
src/send-announce.h
src/snmp_agent.cc
src/snmp_agent.h
src/snmp_core.cc
src/snmp_core.h
src/ssl/Makefile.am
src/ssl/ProxyCerts.h [new file with mode: 0644]
src/ssl/context_storage.cc
src/ssl/context_storage.h
src/ssl/helper.cc
src/ssl/support.cc
src/stat.cc
src/stat.h
src/store.cc
src/store_client.cc
src/store_digest.cc
src/store_digest.h
src/store_dir.cc
src/store_io.cc
src/store_key_md5.h
src/store_log.cc
src/store_log.h
src/store_rebuild.cc
src/store_rebuild.h
src/store_swapin.h
src/store_swapout.cc
src/structs.h
src/tests/stub_cache_cf.cc
src/tests/stub_libcomm.cc
src/tests/stub_libicmp.cc
src/tests/stub_store.cc
src/tests/stub_store_rebuild.cc
src/tests/testCoss.cc
src/tests/testEventLoop.cc
src/tests/testHttpParser.cc
src/tests/testHttpReply.cc
src/tests/testNull.cc
src/tests/testRock.cc
src/tests/testStoreController.cc
src/tests/testStoreHashIndex.cc
src/tests/testStoreSupport.h
src/tests/testUfs.cc
src/tools.cc
src/tools.h
src/tunnel.cc
src/typedefs.h
src/unlinkd.h
src/url.cc
src/urn.cc
src/urn.h
src/wccp.cc
src/wccp.h
src/wccp2.h
src/whois.cc
src/whois.h
src/win32.h
src/wordlist.h

index 05a9d3179edba970d3082d3ef77adc65c6202957..df2402fc94273df2e64036a3e157a6d141959ece 100644 (file)
@@ -2,6 +2,7 @@
 #include "AccessLogEntry.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
+#include "SquidConfig.h"
 #include "ssl/support.h"
 
 #if USE_SSL
index e5cf61285754d39126e52023ef92a0926b9a6acf..96e2ab7ce5d23bf8592cbe9acc6d8b3d6ba9c930 100644 (file)
@@ -35,6 +35,7 @@
 #include "HttpVersion.h"
 #include "HttpRequestMethod.h"
 #include "HierarchyLogEntry.h"
+#include "icp_opcode.h"
 #include "ip/Address.h"
 #include "HttpRequestMethod.h"
 #if ICAP_CLIENT
@@ -48,6 +49,7 @@
 /* forward decls */
 class HttpReply;
 class HttpRequest;
+class CustomLog;
 
 class AccessLogEntry: public RefCountable
 {
@@ -274,11 +276,11 @@ class ACLChecklist;
 class StoreEntry;
 
 /* Should be in 'AccessLog.h' as the driver */
-extern void accessLogLogTo(customlog* log, AccessLogEntry::Pointer &al, ACLChecklist* checklist = NULL);
-extern void accessLogLog(AccessLogEntry::Pointer &, ACLChecklist * checklist);
-extern void accessLogRotate(void);
-extern void accessLogClose(void);
-extern void accessLogInit(void);
-extern const char *accessLogTime(time_t);
+void accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist* checklist = NULL);
+void accessLogLog(AccessLogEntry::Pointer &, ACLChecklist * checklist);
+void accessLogRotate(void);
+void accessLogClose(void);
+void accessLogInit(void);
+const char *accessLogTime(time_t);
 
 #endif /* SQUID_HTTPACCESSLOGENTRY_H */
index f98f36d2cc12b3b5547b3db78d753f752fde82d7..08c57380456ceec61ae0357d813cac46748c95b1 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef SQUID_AUTHREG_H_
 #define SQUID_AUTHREG_H_
 /*
- * DEBUG: section
- * AUTHOR:
+ * DEBUG: section 29    Authenticator
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
index 5ca1ccd31ab0eb97f98f4be3193e95f69b42a8ff..b51cb3e4ff518c6a7fcb89f4e7e2427e53290bcb 100644 (file)
@@ -41,7 +41,6 @@
 #if USE_CACHE_DIGESTS
 
 #include "CacheDigest.h"
-#include "structs.h"
 
 /* local types */
 
index 2d44bf42d69fa2625a483985b3967da40f988819..bcaf91fbb516377d0594a247d436c846ebb0f9fa 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef SQUID_CACHEDIGEST_H_
+#define SQUID_CACHEDIGEST_H_
 /*
  * DEBUG: section 70    Cache Digest
  * AUTHOR: Alex Rousskov
  *
  */
 
-#ifndef SQUID_CACHEDIGEST_H_
-#define SQUID_CACHEDIGEST_H_
-
+/* for cache_key */
 #include "typedefs.h"
+
 class CacheDigestGuessStats;
 class StoreEntry;
 
-extern CacheDigest *cacheDigestCreate(int capacity, int bpe);
-extern void cacheDigestDestroy(CacheDigest * cd);
-extern CacheDigest *cacheDigestClone(const CacheDigest * cd);
-extern void cacheDigestClear(CacheDigest * cd);
-extern void cacheDigestChangeCap(CacheDigest * cd, int new_cap);
-extern int cacheDigestTest(const CacheDigest * cd, const cache_key * key);
-extern void cacheDigestAdd(CacheDigest * cd, const cache_key * key);
-extern void cacheDigestDel(CacheDigest * cd, const cache_key * key);
-extern size_t cacheDigestCalcMaskSize(int cap, int bpe);
-extern int cacheDigestBitUtil(const CacheDigest * cd);
-extern void cacheDigestGuessStatsUpdate(CacheDigestGuessStats * stats, int real_hit, int guess_hit);
-extern void cacheDigestGuessStatsReport(const CacheDigestGuessStats * stats, StoreEntry * sentry, const char *label);
-extern void cacheDigestReport(CacheDigest * cd, const char *label, StoreEntry * e);
+// currently a POD
+class CacheDigest
+{
+public:
+    /* public, read-only */
+    char *mask;         /* bit mask */
+    int mask_size;      /* mask size in bytes */
+    int capacity;       /* expected maximum for .count, not a hard limit */
+    int bits_per_entry;     /* number of bits allocated for each entry from capacity */
+    int count;          /* number of digested entries */
+    int del_count;      /* number of deletions performed so far */
+};
+
+CacheDigest *cacheDigestCreate(int capacity, int bpe);
+void cacheDigestDestroy(CacheDigest * cd);
+CacheDigest *cacheDigestClone(const CacheDigest * cd);
+void cacheDigestClear(CacheDigest * cd);
+void cacheDigestChangeCap(CacheDigest * cd, int new_cap);
+int cacheDigestTest(const CacheDigest * cd, const cache_key * key);
+void cacheDigestAdd(CacheDigest * cd, const cache_key * key);
+void cacheDigestDel(CacheDigest * cd, const cache_key * key);
+size_t cacheDigestCalcMaskSize(int cap, int bpe);
+int cacheDigestBitUtil(const CacheDigest * cd);
+void cacheDigestGuessStatsUpdate(CacheDigestGuessStats * stats, int real_hit, int guess_hit);
+void cacheDigestGuessStatsReport(const CacheDigestGuessStats * stats, StoreEntry * sentry, const char *label);
+void cacheDigestReport(CacheDigest * cd, const char *label, StoreEntry * e);
 
 #endif /* SQUID_CACHEDIGEST_H_ */
index 7a1dc2d75f6e929a3893ef19dcc53ed1a4cac070..bb5885557f82c6cfb1d12ed08f065138660a33d7 100644 (file)
@@ -37,6 +37,8 @@
 #include "mgr/ActionProfile.h"
 #include "mgr/Command.h"
 #include "mgr/forward.h"
+#include "typedefs.h"
+
 #include <vector>
 
 /**
@@ -48,6 +50,9 @@
  */
 
 class HttpRequest;
+namespace Mgr {
+class ActionPasswordList;
+} //namespace Mgr
 /**
  \ingroup CacheManagerAPI
  * a CacheManager - the menu system for interacting with squid.
@@ -83,7 +88,7 @@ protected:
     Mgr::CommandPointer ParseUrl(const char *url);
     void ParseHeaders(const HttpRequest * request, Mgr::ActionParams &params);
     int CheckPassword(const Mgr::Command &cmd);
-    char *PasswdGet(cachemgr_passwd *, const char *);
+    char *PasswdGet(Mgr::ActionPasswordList *, const char *);
 
     void registerProfile(const Mgr::ActionProfilePointer &profile);
 
diff --git a/src/CachePeer.h b/src/CachePeer.h
new file mode 100644 (file)
index 0000000..50cea94
--- /dev/null
@@ -0,0 +1,211 @@
+#ifndef SQUID_CACHEPEER_H_
+#define SQUID_CACHEPEER_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.
+ *
+ */
+
+#include "enums.h"
+#include "icp_opcode.h"
+#include "ip/Address.h"
+
+//TODO: remove, it is unconditionally defined and always used.
+#define PEER_MULTICAST_SIBLINGS 1
+
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
+
+class acl_access;
+class CachePeerDomainList;
+class NeighborTypeDomainList;
+class PeerDigest;
+
+// currently a POD
+class CachePeer
+{
+public:
+    u_int index;
+    char *name;
+    char *host;
+    peer_t type;
+
+    Ip::Address in_addr;
+
+    struct {
+        int pings_sent;
+        int pings_acked;
+        int fetches;
+        int rtt;
+        int ignored_replies;
+        int n_keepalives_sent;
+        int n_keepalives_recv;
+        time_t probe_start;
+        time_t last_query;
+        time_t last_reply;
+        time_t last_connect_failure;
+        time_t last_connect_probe;
+        int logged_state;   /* so we can print dead/revived msgs */
+        int conn_open;      /* current opened connections */
+    } stats;
+
+    struct {
+        int version;
+        int counts[ICP_END+1];
+        unsigned short port;
+    } icp;
+
+#if USE_HTCP
+    struct {
+        double version;
+        int counts[2];
+        unsigned short port;
+    } htcp;
+#endif
+
+    unsigned short http_port;
+    CachePeerDomainList *peer_domain;
+    NeighborTypeDomainList *typelist;
+    acl_access *access;
+
+    struct {
+        unsigned int proxy_only:1;
+        unsigned int no_query:1;
+        unsigned int background_ping:1;
+        unsigned int no_digest:1;
+        unsigned int default_parent:1;
+        unsigned int roundrobin:1;
+        unsigned int weighted_roundrobin:1;
+        unsigned int mcast_responder:1;
+        unsigned int closest_only:1;
+#if USE_HTCP
+        unsigned int htcp:1;
+        unsigned int htcp_oldsquid:1;
+        unsigned int htcp_no_clr:1;
+        unsigned int htcp_no_purge_clr:1;
+        unsigned int htcp_only_clr:1;
+        unsigned int htcp_forward_clr:1;
+#endif
+        unsigned int no_netdb_exchange:1;
+#if USE_DELAY_POOLS
+        unsigned int no_delay:1;
+#endif
+        unsigned int allow_miss:1;
+        unsigned int carp:1;
+        struct {
+            unsigned int set:1; //If false, whole url is to be used. Overrides others
+            unsigned int scheme:1;
+            unsigned int host:1;
+            unsigned int port:1;
+            unsigned int path:1;
+            unsigned int params:1;
+        } carp_key;
+#if USE_AUTH
+        unsigned int userhash:1;
+#endif
+        unsigned int sourcehash:1;
+        unsigned int originserver:1;
+        unsigned int no_tproxy:1;
+#if PEER_MULTICAST_SIBLINGS
+        unsigned int mcast_siblings:1;
+#endif
+    } options;
+
+    int weight;
+    int basetime;
+
+    struct {
+        double avg_n_members;
+        int n_times_counted;
+        int n_replies_expected;
+        int ttl;
+        int id;
+
+        struct {
+            unsigned int count_event_pending:1;
+            unsigned int counting:1;
+        } flags;
+    } mcast;
+#if USE_CACHE_DIGESTS
+
+    PeerDigest *digest;
+    char *digest_url;
+#endif
+
+    int tcp_up;         /* 0 if a connect() fails */
+
+    Ip::Address addresses[10];
+    int n_addresses;
+    int rr_count;
+    CachePeer *next;
+    int testing_now;
+
+    struct {
+        unsigned int hash;
+        double load_multiplier;
+        double load_factor; /* normalized weight value */
+    } carp;
+#if USE_AUTH
+    struct {
+        unsigned int hash;
+        double load_multiplier;
+        double load_factor; /* normalized weight value */
+    } userhash;
+#endif
+    struct {
+        unsigned int hash;
+        double load_multiplier;
+        double load_factor; /* normalized weight value */
+    } sourcehash;
+
+    char *login;        /* Proxy authorization */
+    time_t connect_timeout;
+    int connect_fail_limit;
+    int max_conn;
+    char *domain;       /* Forced domain */
+#if USE_SSL
+
+    int use_ssl;
+    char *sslcert;
+    char *sslkey;
+    int sslversion;
+    char *ssloptions;
+    char *sslcipher;
+    char *sslcafile;
+    char *sslcapath;
+    char *sslcrlfile;
+    char *sslflags;
+    char *ssldomain;
+    SSL_CTX *sslContext;
+    SSL_SESSION *sslSession;
+#endif
+
+    int front_end_https;
+    int connection_auth;
+};
+
+#endif /* SQUID_CACHEPEER_H_ */
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 532ac02153d7ba420a1f6473ad05c6051b18eb25..f881ce00ef26243b47d855c11610fcfd80aafa5e 100644 (file)
 #ifndef SQUID_CONFIGOPTION_H
 #define SQUID_CONFIGOPTION_H
 
-class StoreEntry;
-
 /* for Vector<> */
 #include "Array.h"
 
+class StoreEntry;
+
 /* cache option parsers */
 
 class ConfigOption
index 848428260bcfb8e807f819bfb0c9a66c2a54a8e8..7c81e44256aebaae26f8a56db1516c232fcb88a2 100644 (file)
@@ -35,6 +35,7 @@
 #include "cache_cf.h"
 #include "ConfigParser.h"
 #include "Debug.h"
+#include "fatal.h"
 #include "globals.h"
 
 void
index a77714327458ef600a8d988f9d0302013e8e9004..b3d778f3d25435820ad927c1d111c7fbba4240a8 100644 (file)
@@ -78,6 +78,6 @@ public:
     static char * strtokFile();
 };
 
-extern int parseConfigFile(const char *file_name);
+int parseConfigFile(const char *file_name);
 
 #endif /* SQUID_CONFIGPARSER_H */
index 7cecee29bd93c169744a96cfcfe58c84f0e28432..54f500fa906b623036656adc354d277d039a3533 100644 (file)
@@ -9,7 +9,7 @@
 #include "CpuAffinitySet.h"
 #include "Debug.h"
 #include "globals.h"
-#include "structs.h"
+#include "SquidConfig.h"
 #include "tools.h"
 
 #include <algorithm>
index 1000ddb39fec083308f8c643aa6e6287112ed844..60c9a55dd25bc47090d5e9a4fdcc8f8f244db924 100644 (file)
@@ -59,8 +59,8 @@
 
 /* context-based debugging, the actual type is subject to change */
 typedef int Ctx;
-extern Ctx ctx_enter(const char *descr);
-extern void ctx_exit(Ctx ctx);
+Ctx ctx_enter(const char *descr);
+void ctx_exit(Ctx ctx);
 
 /* defined debug section limits */
 #define MAX_DEBUG_SECTIONS 100
@@ -141,9 +141,9 @@ inline std::ostream& operator <<(std::ostream &os, const uint8_t d)
 #define old_debug(SECTION, LEVEL)  if do_debug((SECTION), (LEVEL)) _db_print
 
 /* Legacy debug function definitions */
-extern void _db_init(const char *logfile, const char *options);
-extern void _db_print(const char *,...) PRINTF_FORMAT_ARG1;
-extern void _db_set_syslog(const char *facility);
-extern void _db_rotate_log(void);
+void _db_init(const char *logfile, const char *options);
+void _db_print(const char *,...) PRINTF_FORMAT_ARG1;
+void _db_set_syslog(const char *facility);
+void _db_rotate_log(void);
 
 #endif /* SQUID_DEBUG_H */
index 0103d607d4ca223845538de5c7d0c8ac65f25e4f..0108ac3afd3701daf9e7193198b3652d7e30d109 100644 (file)
@@ -39,6 +39,7 @@
 #if USE_DELAY_POOLS
 #include "DelayBucket.h"
 #include "DelaySpec.h"
+#include "SquidConfig.h"
 #include "Store.h"
 
 void
index eeef9b71f928d6aaeb8cc426011606fe651dd64e..7527e6915345381365c107b27e9d6c4cda7fc24e 100644 (file)
@@ -48,6 +48,7 @@
 #include "DelayPool.h"
 #include "DelayPools.h"
 #include "HttpRequest.h"
+#include "SquidConfig.h"
 
 DelayId::DelayId () : pool_ (0), compositeId(NULL), markedAsNoDelay(false)
 {}
index 99048a614ba9b807cc2179c7b6a47afb2b0f8385..aa07e33be6ce2a6d361d7f302cc3733ec4d13b2a 100644 (file)
@@ -41,6 +41,7 @@
 #include "fd.h"
 #include "Store.h"
 #include "StatCounters.h"
+#include "SquidConfig.h"
 #include "SquidIpc.h"
 #include "SquidTime.h"
 #include "unlinkd.h"
index 61e379cb5d70452364a94d92ed4649721d7b6dc2..8d0da2a9d403dc2ce06aa811b1df62ddc646dc48 100644 (file)
@@ -38,8 +38,8 @@
 #include "DiskThreadsIOStrategy.h"
 #include "fde.h"
 #include "mgr/Registration.h"
+#include "SquidConfig.h"
 #include "StatCounters.h"
-/* for statfs */
 #include "Store.h"
 
 void
index d6e684583013b04e1f9c4b9906a5251ea9260170..2059dfeb3ea8eeab8cc34d49787c6f134aadb5fa 100644 (file)
 
 #include "squid.h"
 #include "DiskThreads.h"
-
-#include       <stdio.h>
-#include       <sys/stat.h>
-#include       <fcntl.h>
-#include       <pthread.h>
-#include       <errno.h>
-#include       <dirent.h>
-#include       <signal.h>
+#include "SquidConfig.h"
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <errno.h>
+#include <dirent.h>
+#include <signal.h>
 #if HAVE_SCHED_H
-#include       <sched.h>
+#include <sched.h>
 #endif
 #include "DiskIO/DiskThreads/CommIO.h"
 #include "SquidTime.h"
index cc1300d26fee33d506c8f6591ac6dcc2dc74c06f..9523acbef2b8ea898ef1ad0d87ce9614f74a33b4 100644 (file)
 #include "squid_windows.h"
 #include "DiskIO/DiskThreads/CommIO.h"
 #include "DiskThreads.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 
-#include       <stdio.h>
-#include       <sys/stat.h>
-#include       <fcntl.h>
-#include       <errno.h>
-#include       <dirent.h>
-#include       <signal.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <dirent.h>
+#include <signal.h>
 
 #define RIDICULOUS_LENGTH      4096
 
index 8832487183c5b38b4d050f3e481ab5af68c40fd3..83d8f13f86cfb4c8223a94d792986dbd6acc626b 100644 (file)
@@ -18,6 +18,7 @@
 #include "ipc/Queue.h"
 #include "ipc/StrandSearch.h"
 #include "ipc/UdsOp.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "tools.h"
index 29c13bfbb826ffa1b68090651384e63813754a2b..09924a27e63168ebe0fa3482ffdefce5c688b0cf 100644 (file)
@@ -5,7 +5,6 @@
 #ifndef SQUID_DNS_LOOKUP_DETAILS_H
 #define SQUID_DNS_LOOKUP_DETAILS_H
 
-#include "typedefs.h"
 #include "SquidString.h"
 
 /// encapsulates DNS lookup results
index 0c3f1ae945787d97a1f58d61eef79cb7b3fe4b85..9f37a819f5072b3ce4ea7afa15a228fcd950b03c 100644 (file)
@@ -14,10 +14,10 @@ public:
 };
 
 /* ETag */
-SQUIDCEXTERN int etagParseInit(ETag * etag, const char *str);
+int etagParseInit(ETag * etag, const char *str);
 /// whether etags are strong-equal
-SQUIDCEXTERN bool etagIsStrongEqual(const ETag &tag1, const ETag &tag2);
+bool etagIsStrongEqual(const ETag &tag1, const ETag &tag2);
 /// whether etags are weak-equal
-SQUIDCEXTERN bool etagIsWeakEqual(const ETag &tag1, const ETag &tag2);
+bool etagIsWeakEqual(const ETag &tag1, const ETag &tag2);
 
 #endif /* _SQUIDETAG_H */
index 465fdc159d5eed9fc3fb41baca741619c6f9889e..03baa13ba7abc6aafcd42e055979b326d788caa4 100644 (file)
  */
 
 #include "squid.h"
+#include "AsyncEngine.h"
 #include "Debug.h"
 #include "EventLoop.h"
 #include "base/AsyncCallQueue.h"
+#include "SquidTime.h"
+
 
 EventLoop::EventLoop() : errcount(0), last_loop(false), timeService(NULL),
         primaryEngine(NULL)
index bf1bda47449c4fd63fe2cb3bcc20cf040df852d8..63736ddd9476145c71c9cf50a6e6039ff35cd778 100644 (file)
 #define SQUID_EVENTLOOP_H
 
 #include "Array.h"
-#include "AsyncEngine.h"
-#include "SquidTime.h"
 
 #define EVENT_LOOP_TIMEOUT     1000 /* 1s timeout */
 
+class AsyncEngine;
+class TimeEngine;
+
 /** An event loop. An event loop is the core inner loop of squid.
  * The event loop can be run until exit, or once. After it finishes control
  * returns to the caller. If desired it can be run again.
index 9e876e36290324d106b3dfc914cd001c50aa67ee..7d5e3c8a8a9b61a49ec233ad5e7512d2ebb9b4e8 100644 (file)
@@ -33,6 +33,8 @@
 #define SQUID_EXTERNALACL_H
 
 #include "acl/Checklist.h"
+class external_acl;
+class StoreEntry;
 
 /** \todo CLEANUP: kill this typedef. */
 typedef struct _external_acl_data external_acl_data;
@@ -91,15 +93,12 @@ protected:
 
 MEMPROXY_CLASS_INLINE(ACLExternal);
 
-class ACLChecklist;
-class StoreEntry;
-
-extern void parse_externalAclHelper(external_acl **);
-extern void dump_externalAclHelper(StoreEntry * sentry, const char *name, const external_acl *);
-extern void free_externalAclHelper(external_acl **);
+void parse_externalAclHelper(external_acl **);
+void dump_externalAclHelper(StoreEntry * sentry, const char *name, const external_acl *);
+void free_externalAclHelper(external_acl **);
 typedef void EAH(void *data, void *result);
-extern void externalAclLookup(ACLChecklist * ch, void *acl_data, EAH * handler, void *data);
-extern void externalAclInit(void);
-extern void externalAclShutdown(void);
+void externalAclLookup(ACLChecklist * ch, void *acl_data, EAH * handler, void *data);
+void externalAclInit(void);
+void externalAclShutdown(void);
 
 #endif /* SQUID_EXTERNALACL_H */
index 48bf326e9ecf8e46148317fed46ccb81142c0b35..b26d094fa423a171985050715116bc13b2c624fc 100644 (file)
 
 #include "acl/Acl.h"
 #include "cbdata.h"
+#include "hash.h"
+#include "SquidString.h"
 
+class external_acl;
 /******************************************************************
  * ExternalACLEntryData
  * Core data that ExternalACLEntry manages.
index 2de3bacfa02c8fc731fba9a81ec1e584a7c92502..e4fd9f8dd0db663bc2b14e024fd21e35b0c325fe 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "comm/Connection.h"
 #include "hier_code.h"
+#include "HttpStatusCode.h"
 #include "lookup_t.h"
 #include "rfc2181.h"
 #include "PingData.h"
index f9d71a702c5b28002ba4f5729dba43827d4a29c9..eb48996da9973a318e9258c97258bc6e34f1efd7 100644 (file)
@@ -33,6 +33,7 @@
 #include "squid.h"
 #include "base/StringArea.h"
 #include "HttpHeader.h"
+#include "HttpHeaderFieldStat.h"
 #include "HttpHeaderStat.h"
 #include "HttpHeaderTools.h"
 #include "HttpHdrCc.h"
index b539181dc6b94cb5c27adf5643e7a733aed9f81a..366f1524ceb3040bbe5fa03ea4ffaef9cc0bd989 100644 (file)
 
 #include "enums.h"
 #include "MemPool.h"
-#include "Packer.h"
 #include "SquidString.h"
 
+class Packer;
+
 /** Http Cache-Control header representation
  *
  * Store and parse the Cache-Control HTTP header.
@@ -181,10 +182,10 @@ MEMPROXY_CLASS_INLINE(HttpHdrCc);
 class StatHist;
 class StoreEntry;
 
-extern void httpHdrCcInitModule(void);
-extern void httpHdrCcCleanModule(void);
-extern void httpHdrCcUpdateStats(const HttpHdrCc * cc, StatHist * hist);
-extern void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
+void httpHdrCcInitModule(void);
+void httpHdrCcCleanModule(void);
+void httpHdrCcUpdateStats(const HttpHdrCc * cc, StatHist * hist);
+void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
 
 #if _USE_INLINE_
 #include "HttpHdrCc.cci"
index 3d0fd780b365c147c5517ea0e53d8371a87f1aa0..8bfbe897279db0738a16a131a9cb21b9cbb4942d 100644 (file)
@@ -46,15 +46,15 @@ public:
 
 /** \todo CLEANUP: Move httpHdrContRange* functions into the class methods */
 
-SQUIDCEXTERN HttpHdrContRange *httpHdrContRangeCreate(void);
-SQUIDCEXTERN HttpHdrContRange *httpHdrContRangeParseCreate(const char *crange_spec);
+HttpHdrContRange *httpHdrContRangeCreate(void);
+HttpHdrContRange *httpHdrContRangeParseCreate(const char *crange_spec);
 /** returns true if range is valid; inits HttpHdrContRange */
-SQUIDCEXTERN int httpHdrContRangeParseInit(HttpHdrContRange * crange, const char *crange_spec);
-SQUIDCEXTERN void httpHdrContRangeDestroy(HttpHdrContRange * crange);
-SQUIDCEXTERN HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange);
-SQUIDCEXTERN void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packer * p);
+int httpHdrContRangeParseInit(HttpHdrContRange * crange, const char *crange_spec);
+void httpHdrContRangeDestroy(HttpHdrContRange * crange);
+HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange);
+void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packer * p);
 /** inits with given spec */
-SQUIDCEXTERN void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t);
-SQUIDCEXTERN void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t);
+void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t);
+void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t);
 
 #endif /* SQUID_HTTPHDRCONTRANGE_H */
index e514a082c6fb7837652ca31b3305fd40f3f28c7f..f556d805a5136e03f3022b27a3fc28727e960e91 100644 (file)
@@ -36,6 +36,7 @@
 #include "HttpHeaderRange.h"
 #include "client_side_request.h"
 #include "HttpReply.h"
+#include "HttpHeaderTools.h"
 #include "StrList.h"
 
 /*
index ca32ef9801236e1455022757a4d3a8e5d2d4ba79..8a720c4803206ee7bc4cd289e8802c0d76cf97f1 100644 (file)
@@ -37,6 +37,8 @@
 #include "squid.h"
 #include "HttpHdrSc.h"
 #include "HttpHeader.h"
+#include "HttpHeaderFieldInfo.h"
+#include "HttpHeaderFieldStat.h"
 #include "HttpHeaderStat.h"
 #include "HttpHeaderTools.h"
 #include "Store.h"
index 1de4c37ff967e6eb22ee143e771eb5a7f43d457b..c4ea7c28b9a2ed76d92e1b803f12810bf87a59ed 100644 (file)
@@ -69,10 +69,10 @@ private:
 MEMPROXY_CLASS_INLINE(HttpHdrSc);
 
 /* Http Surrogate Control Header Field */
-extern void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
-extern void httpHdrScInitModule (void);
-extern void httpHdrScCleanModule (void);
-extern HttpHdrSc *httpHdrScParseCreate(String const &);
-extern void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
+void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
+void httpHdrScInitModule (void);
+void httpHdrScCleanModule (void);
+HttpHdrSc *httpHdrScParseCreate(String const &);
+void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
 
 #endif /* SQUID_HTTPHDRSURROGATECONTROL_H */
index 9f3aeae86af987a932166b9e7cccec11883cad06..25e583d665f9c70ecc586380a19f21b4e1bfd7ae 100644 (file)
@@ -126,6 +126,6 @@ private:
 
 MEMPROXY_CLASS_INLINE(HttpHdrScTarget);
 
-extern void httpHdrScTargetStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
+void httpHdrScTargetStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
 
 #endif /* SQUID_HTTPHDRSURROGATECONTROLTARGET_H */
index ee10a780345a522fb32658d1d6b372b580ea06fc..1333cf5ccb1a77c8a4dc8242bdfd2d135a8bca8c 100644 (file)
@@ -36,6 +36,7 @@
 #include "HttpHdrContRange.h"
 #include "HttpHdrSc.h"
 #include "HttpHeader.h"
+#include "HttpHeaderFieldInfo.h"
 #include "HttpHeaderStat.h"
 #include "HttpHeaderTools.h"
 #include "MemBuf.h"
@@ -45,6 +46,7 @@
 #include "StatHist.h"
 #include "Store.h"
 #include "StrList.h"
+#include "SquidConfig.h"
 #include "SquidString.h"
 #include "TimeOrTag.h"
 
index c9dba5c47b34cee965f1b0f311e87f369701bffb..b7b3ffbd71ea0a4814b762a5b07e7818a5fe87d2 100644 (file)
 #define SQUID_HTTPHEADER_H
 
 /* because we pass a spec by value */
-#include "HttpHeaderRange.h"
-/* HttpHeader holds a HttpHeaderMask */
 #include "HttpHeaderMask.h"
+#include "MemPool.h"
+#include "SquidString.h"
+
 
 /* class forward declarations */
-class HttpHdrContRange;
 class HttpHdrCc;
-class HttpHdrSc;
+class HttpHdrContRange;
 class HttpHdrRange;
-class String;
+class HttpHdrSc;
+class Packer;
 class StoreEntry;
 
 /* constant attributes of http header fields */
@@ -178,7 +179,10 @@ typedef enum {
     hoEnd
 } http_hdr_owner_type;
 
-struct _HttpHeaderFieldAttrs {
+// currently a POD
+class HttpHeaderFieldAttrs
+{
+public:
     const char *name;
     http_hdr_type id;
     field_type type;
@@ -289,10 +293,10 @@ private:
     HttpHeaderEntry *findLastEntry(http_hdr_type id) const;
 };
 
-extern int httpHeaderParseQuotedString(const char *start, const int len, String *val);
-extern int httpHeaderHasByNameListMember(const HttpHeader * hdr, const char *name, const char *member, const char separator);
-extern void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);
-extern void httpHeaderCalcMask(HttpHeaderMask * mask, http_hdr_type http_hdr_type_enums[], size_t count);
+int httpHeaderParseQuotedString(const char *start, const int len, String *val);
+int httpHeaderHasByNameListMember(const HttpHeader * hdr, const char *name, const char *member, const char separator);
+void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);
+void httpHeaderCalcMask(HttpHeaderMask * mask, http_hdr_type http_hdr_type_enums[], size_t count);
 
 inline bool
 HttpHeader::chunked() const
@@ -301,7 +305,7 @@ HttpHeader::chunked() const
            hasListMember(HDR_TRANSFER_ENCODING, "chunked", ',');
 }
 
-extern void httpHeaderInitModule(void);
-extern void httpHeaderCleanModule(void);
+void httpHeaderInitModule(void);
+void httpHeaderCleanModule(void);
 
 #endif /* SQUID_HTTPHEADER_H */
diff --git a/src/HttpHeaderFieldInfo.h b/src/HttpHeaderFieldInfo.h
new file mode 100644 (file)
index 0000000..1b19007
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef SQUID_HTTPHEADERFIELDINFO_H_
+#define SQUID_HTTPHEADERFIELDINFO_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.
+ *
+ */
+
+#include "SquidString.h"
+#include "HttpHeaderFieldStat.h"
+
+/// compiled version of HttpHeaderFieldAttrs plus stats. Currently a POD.
+class HttpHeaderFieldInfo
+{
+public:
+    HttpHeaderFieldInfo() : id(HDR_ACCEPT), type(ftInvalid) {}
+
+    http_hdr_type id;
+    String name;
+    field_type type;
+    HttpHeaderFieldStat stat;
+};
+
+#endif /* SQUID_HTTPHEADERFIELDINFO_H_ */
diff --git a/src/HttpHeaderFieldStat.h b/src/HttpHeaderFieldStat.h
new file mode 100644 (file)
index 0000000..c0f8d8b
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef SQUID_HTTPHEADERFIELDSTAT_H_
+#define SQUID_HTTPHEADERFIELDSTAT_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.
+ *
+ */
+
+/// per field statistics. Currently a POD.
+class HttpHeaderFieldStat
+{
+public:
+    HttpHeaderFieldStat() : aliveCount(0), seenCount(0), parsCount(0), errCount(0), repCount(0) {}
+
+    int aliveCount;     /* created but not destroyed (count) */
+    int seenCount;      /* number of fields we've seen */
+    int parsCount;      /* number of parsing attempts */
+    int errCount;       /* number of pasring errors */
+    int repCount;       /* number of repetitons */
+};
+
+#endif /* SQUID_HTTPHEADERFIELDSTAT_H_ */
index 6e9dee461b6f7b1b8d8918d3fd1711f23c92010d..febf89ec6eb235e6c36b9e797fd266c4edf0178c 100644 (file)
@@ -33,6 +33,6 @@
 /* big mask for http headers */
 typedef char HttpHeaderMask[12];
 
-SQUIDCEXTERN void httpHeaderMaskInit(HttpHeaderMask * mask, int value);
+void httpHeaderMaskInit(HttpHeaderMask * mask, int value);
 
 #endif /* SQUID_HTTPHEADERMASK_H */
index 5efe8ea5fcc14ef5759787df0c7f33ad5ab00fd0..d1dec803bf4bfeb0a865ae70d70025f85c41145d 100644 (file)
 #ifndef SQUID_HTTPHEADERRANGE_H
 #define SQUID_HTTPHEADERRANGE_H
 
-#include "MemPool.h"
-#include "Range.h"
 #include "Array.h"
+#include "MemPool.h"
 #include "Packer.h"
+#include "Range.h"
 #include "SquidString.h"
 
 class HttpReply;
index deca225b6ece5360ebf3e2c405b0b7cd0b421974..a49091bb527389f027b1644280243cc472f49f2f 100644 (file)
 #include "fde.h"
 #include "HttpHdrContRange.h"
 #include "HttpHeader.h"
+#include "HttpHeaderFieldInfo.h"
 #include "HttpHeaderTools.h"
 #include "HttpRequest.h"
 #include "MemBuf.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "StrList.h"
 
@@ -325,7 +327,7 @@ httpHdrMangle(HttpHeaderEntry * e, HttpRequest * request, int req_or_rep)
     if (!hms)
         return 1;
 
-    const header_mangler *hm = hms->find(*e);
+    const headerMangler *hm = hms->find(*e);
 
     /* mangler or checklist went away. default allow */
     if (!hm || !hm->access_list) {
@@ -369,7 +371,7 @@ httpHdrMangleList(HttpHeader * l, HttpRequest * request, int req_or_rep)
 }
 
 static
-void header_mangler_clean(header_mangler &m)
+void header_mangler_clean(headerMangler &m)
 {
     aclDestroyAccessList(&m.access_list);
     safe_free(m.replacement);
@@ -377,7 +379,7 @@ void header_mangler_clean(header_mangler &m)
 
 static
 void header_mangler_dump_access(StoreEntry * entry, const char *option,
-                                const header_mangler &m, const char *name)
+                                const headerMangler &m, const char *name)
 {
     if (m.access_list != NULL) {
         storeAppendPrintf(entry, "%s ", option);
@@ -387,7 +389,7 @@ void header_mangler_dump_access(StoreEntry * entry, const char *option,
 
 static
 void header_mangler_dump_replacement(StoreEntry * entry, const char *option,
-                                     const header_mangler &m, const char *name)
+                                     const headerMangler &m, const char *name)
 {
     if (m.replacement)
         storeAppendPrintf(entry, "%s %s %s\n", option, name, m.replacement);
@@ -443,7 +445,7 @@ HeaderManglers::dumpReplacement(StoreEntry * entry, const char *name) const
     header_mangler_dump_replacement(entry, name, all, "All");
 }
 
-header_mangler *
+headerMangler *
 HeaderManglers::track(const char *name)
 {
     int id = httpHeaderIdByNameDef(name, strlen(name));
@@ -455,7 +457,7 @@ HeaderManglers::track(const char *name)
             id = HDR_OTHER;
     }
 
-    header_mangler *m = NULL;
+    headerMangler *m = NULL;
     if (id == HDR_ENUM_END) {
         m = &all;
     } else if (id == HDR_BAD_HDR) {
@@ -473,13 +475,13 @@ HeaderManglers::setReplacement(const char *name, const char *value)
 {
     // for backword compatibility, we allow replacements to be configured
     // for headers w/o access rules, but such replacements are ignored
-    header_mangler *m = track(name);
+    headerMangler *m = track(name);
 
     safe_free(m->replacement); // overwrite old value if any
     m->replacement = xstrdup(value);
 }
 
-const header_mangler *
+const headerMangler *
 HeaderManglers::find(const HttpHeaderEntry &e) const
 {
     // a known header with a configured ACL list
index 35ae04529ce9ac975e71ca93f1816acd47c1bee5..bdaf6f7da6741a4c3a6d0d8c0d816815d397305c 100644 (file)
 #include <string>
 #endif
 
+class acl_access;
+class ACLList;
 class HeaderWithAcl;
+class HttpHeader;
+class HttpHeaderFieldInfo;
+class HttpRequest;
+class StoreEntry;
+class String;
+
 typedef std::list<HeaderWithAcl> HeaderWithAclList;
 
-class acl_access;
-struct _header_mangler {
+// Currently a POD
+class headerMangler
+{
+public:
     acl_access *access_list;
     char *replacement;
 };
-typedef struct _header_mangler header_mangler;
-
-class StoreEntry;
 
-/// A collection of header_mangler objects for a given message kind.
+/// A collection of headerMangler objects for a given message kind.
 class HeaderManglers
 {
 public:
@@ -35,10 +42,10 @@ public:
     ~HeaderManglers();
 
     /// returns a header mangler for field e or nil if none was specified
-    const header_mangler *find(const HttpHeaderEntry &e) const;
+    const headerMangler *find(const HttpHeaderEntry &e) const;
 
     /// returns a mangler for the named header (known or custom)
-    header_mangler *track(const char *name);
+    headerMangler *track(const char *name);
 
     /// updates mangler for the named header with a replacement value
     void setReplacement(const char *name, const char *replacementValue);
@@ -50,16 +57,16 @@ public:
 
 private:
     /// a name:mangler map; optimize: use unordered map or some such
-    typedef std::map<std::string, header_mangler> ManglersByName;
+    typedef std::map<std::string, headerMangler> ManglersByName;
 
     /// one mangler for each known header
-    header_mangler known[HDR_ENUM_END];
+    headerMangler known[HDR_ENUM_END];
 
     /// one mangler for each custom header
     ManglersByName custom;
 
     /// configured if some mangling ACL applies to all header names
-    header_mangler all;
+    headerMangler all;
 
 private:
     /* not implemented */
@@ -67,7 +74,6 @@ private:
     HeaderManglers &operator =(const HeaderManglers &);
 };
 
-class ACLList;
 class HeaderWithAcl
 {
 public:
@@ -92,24 +98,19 @@ public:
     bool quoted;
 };
 
-extern int httpHeaderParseOffset(const char *start, int64_t * off);
-
-class HttpHeaderFieldInfo;
-class String;
-class HttpHeader;
-class HttpRequest;
+int httpHeaderParseOffset(const char *start, int64_t * off);
 
-extern HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count);
-extern void httpHeaderDestroyFieldsInfo(HttpHeaderFieldInfo * info, int count);
-extern http_hdr_type httpHeaderIdByName(const char *name, size_t name_len, const HttpHeaderFieldInfo * attrs, int end);
-extern http_hdr_type httpHeaderIdByNameDef(const char *name, int name_len);
-extern const char *httpHeaderNameById(int id);
-extern int httpHeaderHasConnDir(const HttpHeader * hdr, const char *directive);
-extern int httpHeaderParseInt(const char *start, int *val);
-extern void httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char *fmt,...) PRINTF_FORMAT_ARG3;
+HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count);
+void httpHeaderDestroyFieldsInfo(HttpHeaderFieldInfo * info, int count);
+http_hdr_type httpHeaderIdByName(const char *name, size_t name_len, const HttpHeaderFieldInfo * attrs, int end);
+http_hdr_type httpHeaderIdByNameDef(const char *name, int name_len);
+const char *httpHeaderNameById(int id);
+int httpHeaderHasConnDir(const HttpHeader * hdr, const char *directive);
+int httpHeaderParseInt(const char *start, int *val);
+void httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char *fmt,...) PRINTF_FORMAT_ARG3;
 
-extern const char *getStringPrefix(const char *str, const char *end);
+const char *getStringPrefix(const char *str, const char *end);
 
-extern void httpHdrMangleList(HttpHeader *, HttpRequest *, int req_or_rep);
+void httpHdrMangleList(HttpHeader *, HttpRequest *, int req_or_rep);
 
 #endif
index 4ef8d53161d7ce8e3231f650b0aed6d8581ee503..88d22f0f631a76635c60f348573cea3d0c119aa9 100644 (file)
@@ -38,6 +38,7 @@
 #include "MemBuf.h"
 #include "mime_header.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 
 HttpMsg::HttpMsg(http_hdr_owner_type owner): header(owner),
         cache_control(NULL), hdr_sz(0), content_length(0), protocol(AnyP::PROTO_NONE),
index 8193c0aebde80a81aa109bfcb61db392e88121a9..39ebeb30449b32c70372e522382d5007a65f501d 100644 (file)
@@ -1,8 +1,8 @@
 #include "squid.h"
 #include "Debug.h"
 #include "HttpParser.h"
-#include "structs.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 
 void
 HttpParser::clear()
index 0541e27daf1704cbbdb8aba51bbe608ba5232059..349eeaf962b8385db459becbd812187f54e814fa 100644 (file)
@@ -79,14 +79,14 @@ public:
 
 // Legacy functions
 #define HttpParserInit(h,b,l) (h)->reset((b),(l))
-extern int HttpParserParseReqLine(HttpParser *hp);
+int HttpParserParseReqLine(HttpParser *hp);
 
 #define MSGDODEBUG 0
 #if MSGDODEBUG
-extern int HttpParserReqSz(HttpParser *);
-extern int HttpParserHdrSz(HttpParser *);
-extern const char * HttpParserHdrBuf(HttpParser *);
-extern int HttpParserRequestLen(HttpParser *hp);
+int HttpParserReqSz(HttpParser *);
+int HttpParserHdrSz(HttpParser *);
+const char * HttpParserHdrBuf(HttpParser *);
+int HttpParserRequestLen(HttpParser *hp);
 #else
 #define HttpParserReqSz(hp)     ( (hp)->req.end - (hp)->req.start + 1 )
 #define HttpParserHdrSz(hp)     ( (hp)->hdr_end - (hp)->hdr_start + 1 )
index aa940c94dfc28fce0b79ad67d1df1a17739ee55d..44bdc5a671f0d469e359214a41d6f91a6ff03a9f 100644 (file)
 #include "HttpReply.h"
 #include "HttpRequest.h"
 #include "MemBuf.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StrList.h"
+#include "structs.h"
 
 /* local constants */
 
index 687236314a6d97b67cc16fcc0bd69217525c9ecd..a5a50f9a34b124c3256583118bae977f34a3b146 100644 (file)
 #include "HttpRequest.h"
 #include "HttpStatusLine.h"
 
-extern void httpReplyInitModule(void);
+void httpReplyInitModule(void);
 
 #if DEAD_CODE
 /** do everything in one call: init, set, pack, clean, return MemBuf */
-extern MemBuf *httpPackedReply(HttpVersion ver, http_status status, const char *ctype, int64_t clen, time_t lmt, time_t expires);
+MemBuf *httpPackedReply(HttpVersion ver, http_status status, const char *ctype, int64_t clen, time_t lmt, time_t expires);
 #endif
 
 /* Sync changes here with HttpReply.cc */
index 784e5ec784e954ca230d7a8d34b2499a52486ad4..2556e514c155c8fbef0cbfb1b4c490a4694b435e 100644 (file)
@@ -45,6 +45,7 @@
 #include "HttpRequest.h"
 #include "log/Config.h"
 #include "MemBuf.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "URL.h"
 
@@ -419,27 +420,6 @@ HttpRequest::hdrCacheInit()
     range = header.getRange();
 }
 
-/* request_flags */
-bool
-request_flags::resetTCP() const
-{
-    return reset_tcp != 0;
-}
-
-void
-request_flags::setResetTCP()
-{
-    debugs(73, 9, "request_flags::setResetTCP");
-    reset_tcp = 1;
-}
-
-void
-request_flags::clearResetTCP()
-{
-    debugs(73, 9, "request_flags::clearResetTCP");
-    reset_tcp = 0;
-}
-
 #if ICAP_CLIENT
 Adaptation::Icap::History::Pointer
 HttpRequest::icapHistory() const
@@ -492,27 +472,6 @@ HttpRequest::multipartRangeRequest() const
     return (range && range->specs.count > 1);
 }
 
-void
-request_flags::destinationIPLookupCompleted()
-{
-    destinationIPLookedUp_ = true;
-}
-
-bool
-request_flags::destinationIPLookedUp() const
-{
-    return destinationIPLookedUp_;
-}
-
-request_flags
-request_flags::cloneAdaptationImmune() const
-{
-    // At the time of writing, all flags where either safe to copy after
-    // adaptation or were not set at the time of the adaptation. If there
-    // are flags that are different, they should be cleared in the clone.
-    return *this;
-}
-
 bool
 HttpRequest::bodyNibbled() const
 {
@@ -622,7 +581,7 @@ HttpRequest::cacheable() const
     // Because it failed verification, or someone bypassed the security tests
     // we cannot cache the reponse for sharing between clients.
     // TODO: update cache to store for particular clients only (going to same Host: and destination IP)
-    if (!flags.hostVerified && (flags.intercepted || flags.spoof_client_ip))
+    if (!flags.hostVerified && (flags.intercepted || flags.spoofClientIp))
         return false;
 
     if (protocol == AnyP::PROTO_HTTP)
index 18899036093677cb5f4f88e9f1a3edc63b9de2b9..9c760f1ae7c06c452592664b454a9ba53562c6e3 100644 (file)
 
 #include "base/CbcPointer.h"
 #include "Debug.h"
+#include "err_type.h"
 #include "HierarchyLogEntry.h"
 #include "HttpMsg.h"
 #include "HttpRequestMethod.h"
+#include "RequestFlags.h"
 
 #if USE_AUTH
 #include "auth/UserRequest.h"
@@ -55,7 +57,7 @@ class ConnStateData;
 
 /*  Http Request */
 //DEAD?: extern int httpRequestHdrAllowedByName(http_hdr_type id);
-extern void httpRequestPack(void *obj, Packer *p);
+void httpRequestPack(void *obj, Packer *p);
 
 class HttpHdrRange;
 class DnsLookupDetails;
@@ -161,7 +163,7 @@ public:
 
     char *canonical;
 
-    request_flags flags;
+    RequestFlags flags;
 
     HttpHdrRange *range;
 
index 7aef78ee3a2b9e42fbc99cb346face3c06628cfa..11090dc22975a66043f896afc21a72813101f375 100644 (file)
@@ -32,7 +32,8 @@
 #define SQUID_HTTPREQUESTMETHOD_H
 
 #include "SquidString.h"
-#include "structs.h"
+
+class SquidConfig;
 
 #include <iosfwd>
 
diff --git a/src/HttpStateFlags.h b/src/HttpStateFlags.h
new file mode 100644 (file)
index 0000000..c57ab16
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef SQUID_HTTPSTATEFLAGS_H_
+#define SQUID_HTTPSTATEFLAGS_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.
+ *
+ */
+
+// POD
+class HttpStateFlags
+{
+public:
+    bool proxying:1;
+    bool keepalive:1;
+    bool only_if_cached:1;
+    bool handling1xx:1; ///< we are ignoring or forwarding 1xx response
+    bool headers_parsed:1;
+    unsigned int front_end_https:2; //XXX: huh?
+    bool originpeer:1;
+    bool keepalive_broken:1;
+    bool abuse_detected:1;
+    bool request_sent:1;
+    bool do_next_read:1;
+    bool consume_body_data:1; //XXX: seems unused
+    bool chunked:1; ///< reading a chunked response; TODO: rename
+    bool chunked_request:1; ///< writing a chunked request
+    bool sentLastChunk:1; ///< do not try to write last-chunk again
+};
+
+#endif /* SQUID_HTTPSTATEFLAGS_H_ */
index fe6481df3e9bcdbf01939be036a39a5cf4815fef..a334b89b67fcc7d790f86d8c8828fb1df82301f1 100644 (file)
--- a/src/ICP.h
+++ b/src/ICP.h
@@ -76,6 +76,7 @@ struct _icp_common_t {
     icp_opcode getOpCode() const;
 #endif
 };
+typedef struct _icp_common_t icp_common_t;
 
 #ifdef __cplusplus
 
@@ -131,51 +132,51 @@ extern Comm::ConnectionPointer icpOutgoingConn;
 extern Ip::Address theIcpPublicHostID;
 
 /// \ingroup ServerProtocolICPAPI
-extern HttpRequest* icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from);
+HttpRequest* icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from);
 
 /// \ingroup ServerProtocolICPAPI
-extern bool icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request);
+bool icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from);
+void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from);
 
 /// \ingroup ServerProtocolICPAPI
-extern icp_opcode icpGetCommonOpcode();
+icp_opcode icpGetCommonOpcode();
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN int icpUdpSend(int, const Ip::Address &, icp_common_t *, log_type, int);
+int icpUdpSend(int, const Ip::Address &, icp_common_t *, log_type, int);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN log_type icpLogFromICPCode(icp_opcode opcode);
+log_type icpLogFromICPCode(icp_opcode opcode);
 
 /// \ingroup ServerProtocolICPAPI
 void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN PF icpHandleUdp;
+PF icpHandleUdp;
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN PF icpUdpSendQueue;
+PF icpUdpSendQueue;
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpHandleIcpV3(int, Ip::Address &, char *, int);
+void icpHandleIcpV3(int, Ip::Address &, char *, int);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN int icpCheckUdpHit(StoreEntry *, HttpRequest * request);
+int icpCheckUdpHit(StoreEntry *, HttpRequest * request);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpOpenPorts(void);
+void icpOpenPorts(void);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpConnectionShutdown(void);
+void icpConnectionShutdown(void);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpClosePorts(void);
+void icpClosePorts(void);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN int icpSetCacheKey(const cache_key * key);
+int icpSetCacheKey(const cache_key * key);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN const cache_key *icpGetCacheKey(const char *url, int reqnum);
+const cache_key *icpGetCacheKey(const char *url, int reqnum);
 
 #endif /* SQUID_ICP_H */
diff --git a/src/IoStats.h b/src/IoStats.h
new file mode 100644 (file)
index 0000000..0e6c0ac
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef SQUID_IOSTATS_H_
+#define SQUID_IOSTATS_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.
+ *
+ */
+
+/// IO statistics. Currently a POD.
+class IoStats
+{
+public:
+    static const int histSize=16;
+
+    struct {
+        int reads;
+        int reads_deferred;
+        int read_hist[histSize];
+        int writes;
+        int write_hist[histSize];
+    }
+    Http, Ftp, Gopher;
+};
+
+#endif /* SQUID_IOSTATS_H_ */
index 92d622eff5adf4d41cfc8c8224a9234131837a96..428135d4bfef65d18b03943a6d7aee861aab30bf 100644 (file)
@@ -5,6 +5,6 @@
 // TODO: add reconfiguration support
 
 class wordlist;
-extern void LoadableModulesConfigure(const wordlist *names);
+void LoadableModulesConfigure(const wordlist *names);
 
 #endif /* SQUID_LOADABLE_MODULES_H */
index 4afc3dd211ac3ab9a2c766ec6bead22424bf4358..3ab295d09a0409ee93a326cf07178a1b56e7ad4e 100644 (file)
@@ -57,6 +57,7 @@ endif
 DIST_SUBDIRS += ssl
 
 SNMP_ALL_SOURCE = \
+       SnmpRequest.h \
        snmp_core.h \
        snmp_core.cc \
        snmp_agent.h \
@@ -258,6 +259,7 @@ libsquid_la_SOURCES = \
        CommCalls.h \
        DescriptorSet.cc \
        DescriptorSet.h \
+       SquidConfig.h \
        SquidConfig.cc
 
 squid_SOURCES = \
@@ -268,10 +270,16 @@ squid_SOURCES = \
        AsyncEngine.h \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        CacheDigest.h \
        CacheDigest.cc \
        cache_manager.cc \
+       NeighborTypeDomainList.h \
+       CachePeerDomainList.h \
+       CachePeer.h \
        CacheManager.h \
        carp.h \
        carp.cc \
@@ -357,11 +365,13 @@ squid_SOURCES = \
        hier_code.h \
        HierarchyLogEntry.h \
        $(HTCPSOURCE) \
+       HttpStateFlags.h \
        http.cc \
        http.h \
        HttpStatusCode.h \
        HttpStatusLine.cc \
        HttpStatusLine.h \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -377,6 +387,7 @@ squid_SOURCES = \
        HttpHeader.cc \
        HttpHeaderMask.h \
        HttpHeaderRange.h \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpBody.h \
@@ -388,6 +399,8 @@ squid_SOURCES = \
        HttpParser.h \
        HttpReply.cc \
        HttpReply.h \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequest.h \
        HttpRequestMethod.cc \
@@ -457,6 +470,7 @@ squid_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        SquidNew.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -1106,6 +1120,7 @@ tests_testHttpReply_SOURCES=\
        ETag.cc \
        HttpBody.h \
        HttpBody.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -1119,6 +1134,7 @@ tests_testHttpReply_SOURCES=\
        HttpHeader.h \
        HttpHeader.cc \
        HttpHeaderMask.h \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpControlMsg.h \
@@ -1131,6 +1147,8 @@ tests_testHttpReply_SOURCES=\
        HttpStatusLine.h \
        Mem.h \
        mem.cc \
+       RegexList.h \
+       RegexList.cc \
        MemBuf.cc \
        MemBuf.h \
        mime_header.h \
@@ -1145,6 +1163,7 @@ tests_testHttpReply_SOURCES=\
        log/access_log.h \
        tests/stub_access_log.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
@@ -1207,10 +1226,12 @@ tests_testACLMaxUserIP_SOURCES= \
        HttpBody.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -1253,6 +1274,7 @@ tests_testACLMaxUserIP_SOURCES= \
        log/access_log.h \
        tests/stub_access_log.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_debug.cc \
        tests/stub_DelayId.cc \
@@ -1349,6 +1371,8 @@ tests_testCacheManager_SOURCES = \
        debug.cc \
        HttpParser.cc \
        HttpParser.h \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        Mem.h \
@@ -1365,6 +1389,9 @@ tests_testCacheManager_SOURCES = \
        cache_manager.cc \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        CacheDigest.h \
        CacheDigest.cc \
@@ -1415,13 +1442,16 @@ tests_testCacheManager_SOURCES = \
        HelperChildConfig.h \
        HelperChildConfig.cc \
        $(HTCPSOURCE) \
+       HttpStateFlags.h \
        http.cc \
        HttpBody.h \
        HttpBody.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -1473,6 +1503,7 @@ tests_testCacheManager_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -1593,6 +1624,7 @@ tests_testDiskIO_SOURCES = \
        filemap.cc \
        HttpBody.h \
        HttpBody.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -1600,6 +1632,7 @@ tests_testDiskIO_SOURCES = \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
        HttpHdrRange.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpHeader.h \
@@ -1622,6 +1655,8 @@ tests_testDiskIO_SOURCES = \
        refresh.h \
        refresh.cc \
        RemovalPolicy.cc \
+       RequestFlags.h \
+       RequestFlags.cc \
        StatCounters.h \
        StatCounters.cc \
        StatHist.h \
@@ -1653,6 +1688,7 @@ tests_testDiskIO_SOURCES = \
        tests/stub_access_log.cc \
        tests/stub_acl.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_client_db.cc \
@@ -1748,6 +1784,9 @@ tests_testEvent_SOURCES = \
        CacheDigest.cc \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        cache_manager.cc \
        carp.h \
@@ -1806,8 +1845,10 @@ tests_testEvent_SOURCES = \
        HttpBody.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -1819,6 +1860,8 @@ tests_testEvent_SOURCES = \
        HttpParser.cc \
        HttpParser.h \
        HttpReply.cc \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        HttpStatusLine.cc \
@@ -1867,6 +1910,7 @@ tests_testEvent_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.cc \
        SquidMath.h \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -1981,6 +2025,9 @@ tests_testEventLoop_SOURCES = \
        cache_manager.cc \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        carp.h \
        carp.cc \
@@ -2038,8 +2085,10 @@ tests_testEventLoop_SOURCES = \
        HttpBody.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -2051,6 +2100,8 @@ tests_testEventLoop_SOURCES = \
        HttpParser.cc \
        HttpParser.h \
        HttpReply.cc \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        HttpStatusLine.cc \
@@ -2097,6 +2148,7 @@ tests_testEventLoop_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -2209,6 +2261,9 @@ tests_test_http_range_SOURCES = \
        BodyPipe.cc \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        cache_manager.cc \
        CacheDigest.h \
@@ -2265,6 +2320,7 @@ tests_test_http_range_SOURCES = \
        http.cc \
        HttpBody.h \
        HttpBody.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -2274,12 +2330,15 @@ tests_test_http_range_SOURCES = \
        HttpHdrScTarget.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpMsg.cc \
        HttpParser.cc \
        HttpParser.h \
        HttpReply.cc \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        HttpStatusLine.cc \
@@ -2326,6 +2385,7 @@ tests_test_http_range_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -2440,6 +2500,7 @@ tests_testHttpParser_SOURCES = \
        String.cc \
        structs.h \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
@@ -2473,6 +2534,8 @@ tests_testHttpRequest_SOURCES = \
        $(ACL_REGISTRATION_SOURCES) \
        HttpParser.cc \
        HttpParser.h \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        Mem.h \
@@ -2492,6 +2555,9 @@ tests_testHttpRequest_SOURCES = \
        cache_manager.cc \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        debug.cc \
        CacheDigest.h \
@@ -2544,8 +2610,10 @@ tests_testHttpRequest_SOURCES = \
        HttpBody.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -2597,6 +2665,7 @@ tests_testHttpRequest_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -2712,6 +2781,7 @@ tests_testStore_SOURCES= \
        EventLoop.cc \
        FileMap.h \
        filemap.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -2719,12 +2789,15 @@ tests_testStore_SOURCES= \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpHeader.h \
        HttpHeader.cc \
        HttpMsg.cc \
        HttpRequestMethod.cc \
+       RequestFlags.cc \
+       RequestFlags.h \
        int.h \
        int.cc \
        SquidList.h \
@@ -2769,6 +2842,7 @@ tests_testStore_SOURCES= \
        tests/stub_access_log.cc \
        tests/stub_acl.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_client_side_request.cc \
@@ -2867,6 +2941,7 @@ tests_testString_SOURCES = \
        tests/testString.cc \
        tests/testString.h \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
@@ -2943,6 +3018,8 @@ tests_testUfs_SOURCES = \
        HttpStatusLine.cc \
        int.h \
        int.cc \
+       RequestFlags.h \
+       RequestFlags.cc \
        SquidList.h \
        SquidList.cc \
        MemObject.cc \
@@ -2980,6 +3057,7 @@ tests_testUfs_SOURCES = \
        SwapDir.cc \
        tests/stub_acl.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_helper.cc \
        cbdata.cc \
@@ -2991,6 +3069,7 @@ tests_testUfs_SOURCES = \
        stmem.cc \
        mime.h \
        tests/stub_mime.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpHeader.h \
@@ -3001,6 +3080,7 @@ tests_testUfs_SOURCES = \
        MemBuf.cc \
        HttpHdrContRange.cc \
        Packer.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -3090,6 +3170,7 @@ tests_testRock_SOURCES = \
        fd.cc \
        FileMap.h \
        filemap.cc \
+       HttpHeaderFieldStat.h \
        HttpBody.h \
        HttpBody.cc \
        HttpHdrCc.cc \
@@ -3099,6 +3180,7 @@ tests_testRock_SOURCES = \
        HttpHdrScTarget.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpMsg.cc \
@@ -3117,6 +3199,8 @@ tests_testRock_SOURCES = \
        Packer.cc \
        Parsing.cc \
        RemovalPolicy.cc \
+       RequestFlags.cc \
+       RequestFlags.h \
        StatCounters.h \
        StatCounters.cc \
        StatHist.h \
@@ -3152,6 +3236,7 @@ tests_testRock_SOURCES = \
        log/access_log.h \
        tests/stub_access_log.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        client_db.h \
@@ -3288,6 +3373,7 @@ tests_testCoss_SOURCES = \
        SwapDir.cc \
        tests/stub_acl.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_helper.cc \
        cbdata.cc \
@@ -3298,6 +3384,7 @@ tests_testCoss_SOURCES = \
        stmem.cc \
        mime.h \
        tests/stub_mime.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpHeader.h \
@@ -3308,6 +3395,7 @@ tests_testCoss_SOURCES = \
        MemBuf.cc \
        HttpHdrContRange.cc \
        Packer.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -3439,6 +3527,7 @@ tests_testNull_SOURCES = \
        SwapDir.cc \
        tests/stub_acl.cc \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_helper.cc \
        cbdata.cc \
@@ -3451,6 +3540,7 @@ tests_testNull_SOURCES = \
        stmem.cc \
        mime.h \
        tests/stub_mime.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpHeader.h \
@@ -3461,6 +3551,7 @@ tests_testNull_SOURCES = \
        MemBuf.cc \
        HttpHdrContRange.cc \
        Packer.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -3530,6 +3621,9 @@ tests_testURL_SOURCES = \
        BodyPipe.cc \
        cache_cf.h \
        AuthReg.h \
+       YesNoNone.h \
+       YesNoNone.cc \
+       RefreshPattern.h \
        cache_cf.cc \
        cache_manager.cc \
        CacheDigest.h \
@@ -3585,6 +3679,7 @@ tests_testURL_SOURCES = \
        http.cc \
        HttpBody.h \
        HttpBody.cc \
+       HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
        HttpHdrCc.cci \
@@ -3594,12 +3689,15 @@ tests_testURL_SOURCES = \
        HttpHdrScTarget.cc \
        HttpHeader.h \
        HttpHeader.cc \
+       HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
        HttpMsg.cc \
        HttpParser.cc \
        HttpParser.h \
        HttpReply.cc \
+       RequestFlags.h \
+       RequestFlags.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        HttpStatusLine.cc \
@@ -3646,6 +3744,7 @@ tests_testURL_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -3681,8 +3780,8 @@ tests_testURL_SOURCES = \
        StoreMetaVary.cc \
        StoreSwapLogData.cc \
        String.cc \
-    StrList.h \
-    StrList.cc \
+       StrList.h \
+       StrList.cc \
        SwapDir.cc \
        MemStore.cc \
        tests/stub_debug.cc \
@@ -3765,6 +3864,7 @@ tests_testConfigParser_SOURCES = \
        tests/testConfigParser.cc \
        tests/testConfigParser.h \
        cache_cf.h \
+       YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
index 5d3cd994cfb30744d3a3efaa9e179138f48656e1..82c047cd6452d99b04e09ae00dcd4556cce4858b 100644 (file)
--- a/src/Mem.h
+++ b/src/Mem.h
@@ -62,21 +62,21 @@ protected:
 
 extern const size_t squidSystemPageSize;
 
-extern void memClean(void);
-extern void memInitModule(void);
-extern void memCleanModule(void);
-extern void memConfigure(void);
-extern void *memAllocate(mem_type);
-extern void *memAllocString(size_t net_size, size_t * gross_size);
-extern void *memAllocBuf(size_t net_size, size_t * gross_size);
-extern void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size);
-extern void memFree(void *, int type);
-extern void memFreeString(size_t size, void *);
-extern void memFreeBuf(size_t size, void *);
-extern FREE *memFreeBufFunc(size_t size);
-extern int memInUse(mem_type);
-extern void memDataInit(mem_type, const char *, size_t, int, bool zeroOnPush = true);
-extern void memCheckInit(void);
-extern void memConfigure(void);
+void memClean(void);
+void memInitModule(void);
+void memCleanModule(void);
+void memConfigure(void);
+void *memAllocate(mem_type);
+void *memAllocString(size_t net_size, size_t * gross_size);
+void *memAllocBuf(size_t net_size, size_t * gross_size);
+void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size);
+void memFree(void *, int type);
+void memFreeString(size_t size, void *);
+void memFreeBuf(size_t size, void *);
+FREE *memFreeBufFunc(size_t size);
+int memInUse(mem_type);
+void memDataInit(mem_type, const char *, size_t, int, bool zeroOnPush = true);
+void memCheckInit(void);
+void memConfigure(void);
 
 #endif /* SQUID_MEM */
index e2e7c818efda66198c3a78e964c49556b3f433ec..ecee3fdc7639ee0d7d3787d6b71ec178686b1b9e 100644 (file)
@@ -40,6 +40,7 @@
 #include "MemBuf.h"
 #include "MemObject.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "StoreClient.h"
 
index 9967a5d06d30737ea30b2aa7b235aa932872dcc1..a4548b0fb4ae302d482f20f83d38eeedc87cd53a 100644 (file)
 #ifndef SQUID_MEMOBJECT_H
 #define SQUID_MEMOBJECT_H
 
-#include "StoreIOBuffer.h"
-#include "StoreIOState.h"
-#include "stmem.h"
 #include "CommRead.h"
-#include "RemovalPolicy.h"
+#include "dlink.h"
 #include "HttpRequestMethod.h"
+#include "RemovalPolicy.h"
+#include "stmem.h"
+#include "StoreIOBuffer.h"
+#include "StoreIOState.h"
+
+#if USE_DELAY_POOLS
+#include "DelayId.h"
+#endif
 
 typedef void STMCB (void *data, StoreIOBuffer wroteBuffer);
 
 class store_client;
 class HttpRequest;
-#if USE_DELAY_POOLS
-#include "DelayId.h"
-#endif
+class HttpReply;
 
 class MemObject
 {
index 090106b3168f383a76b9401db37020b7eea4a5f6..c6fb09b947ffb88c1ac2bae7dadc8b63d4469a79 100644 (file)
@@ -11,6 +11,7 @@
 #include "MemObject.h"
 #include "MemStore.h"
 #include "mime_header.h"
+#include "SquidConfig.h"
 #include "StoreStats.h"
 #include "tools.h"
 
diff --git a/src/NeighborTypeDomainList.h b/src/NeighborTypeDomainList.h
new file mode 100644 (file)
index 0000000..7bb6961
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef SQUID_NEIGHBORTYPEDOMAINLIST_H_
+#define SQUID_NEIGHBORTYPEDOMAINLIST_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 a neighbor_type_domain configuration directive. A POD
+class NeighborTypeDomainList
+{
+public:
+    char *domain;
+    peer_t type;
+    NeighborTypeDomainList *next;
+};
+
+#endif /* SQUID_NEIGHBORTYPEDOMAINLIST_H_ */
index 9d9280601ee6471b31d131b304573f28ff7b3936..291673b1c610dcf4047a696ee35707e5ab7b16a5 100644 (file)
 
 #include "ip/Address.h"
 
-extern double xatof(const char *token);
-extern int xatoi(const char *token);
-extern long xatol(const char *token);
-extern unsigned short xatos(const char *token);
+double xatof(const char *token);
+int xatoi(const char *token);
+long xatol(const char *token);
+unsigned short xatos(const char *token);
 
 /**
  * Parse a 64-bit integer value.
  */
-extern int64_t GetInteger64(void);
+int64_t GetInteger64(void);
 
 /**
  * Parses an integer value.
  * Uses a method that obeys hexadecimal 0xN syntax needed for certain bitmasks.
  */
-extern int GetInteger(void);
+int GetInteger(void);
 
-extern unsigned short GetShort(void);
+unsigned short GetShort(void);
 
 // on success, returns true and sets *p (if any) to the end of the integer
-extern bool StringToInt(const char *str, int &result, const char **p, int base);
-extern bool StringToInt64(const char *str, int64_t &result, const char **p, int base);
+bool StringToInt(const char *str, int &result, const char **p, int base);
+bool StringToInt64(const char *str, int64_t &result, const char **p, int base);
 
 /**
  * Parse a socket address (host:port), fill the given Ip::Address object
@@ -64,6 +64,6 @@ extern bool StringToInt64(const char *str, int64_t &result, const char **p, int
  * \retval true      Success.
  * Destroys token during parse.
  */
-extern bool GetHostWithPort(char *token, Ip::Address *ipa);
+bool GetHostWithPort(char *token, Ip::Address *ipa);
 
 #endif /* SQUID_PARSING_H */
index b6b9025a0a351e3714e0c3ae53a5e2a631ce67db..f261d4e9b58e341416bce14855d58d301c7eafc7 100644 (file)
@@ -38,7 +38,9 @@
 /* for CacheDigestGuessStats */
 #include "StatCounters.h"
 
-struct _Version {
+class Version
+{
+public:
     short int current;         /* current version */
     short int required;                /* minimal version that can safely handle current version */
 };
@@ -59,7 +61,10 @@ public:
     int reserved[32 - 6];
 };
 
-struct _DigestFetchState {
+class PeerDigest;
+class DigestFetchState
+{
+public:
     PeerDigest *pd;
     StoreEntry *entry;
     StoreEntry *old_entry;
@@ -90,7 +95,7 @@ public:
     void *operator new (size_t);
     void operator delete(void *);
 
-    struct peer *peer;          /**< pointer back to peer structure, argh */
+    CachePeer *peer;          /**< pointer back to peer structure, argh */
     CacheDigest *cd;            /**< actual digest structure */
     String host;                /**< copy of peer->host */
     const char *req_result;     /**< text status of the last request */
@@ -129,10 +134,10 @@ private:
 
 extern const Version CacheDigestVer;
 
-extern PeerDigest *peerDigestCreate(peer * p);
-extern void peerDigestNeeded(PeerDigest * pd);
-extern void peerDigestNotePeerGone(PeerDigest * pd);
-extern void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
+PeerDigest *peerDigestCreate(CachePeer * p);
+void peerDigestNeeded(PeerDigest * pd);
+void peerDigestNotePeerGone(PeerDigest * pd);
+void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
 
 #endif /* USE_CACHE_DIGESTS */
 
index 63c76b2e5a317ca551a41430ee44c18d2c713e75..e589e6cf1ac408e1602f0ec51f14ce8c106152ca 100644 (file)
@@ -51,18 +51,18 @@ SQUIDCEXTERN void peerSelect(Comm::ConnectionList *, HttpRequest *, StoreEntry *
 SQUIDCEXTERN void peerSelectInit(void);
 
 /**
- * A peer which has been selected as a possible destination.
+ * A CachePeer which has been selected as a possible destination.
  * Listed as pointers here so as to prevent duplicates being added but will
  * be converted to a set of IP address path options before handing back out
  * to the caller.
  *
  * Certain connection flags and outgoing settings will also be looked up and
- * set based on the received request and peer settings before handing back.
+ * set based on the received request and CachePeer settings before handing back.
  */
 class FwdServer
 {
 public:
-    peer *_peer;                /* NULL --> origin server */
+    CachePeer *_peer;                /* NULL --> origin server */
     hier_code code;
     FwdServer *next;
 };
@@ -86,21 +86,21 @@ public:
     FwdServer *servers;    ///< temporary linked list of peers we will pass back.
 
     /*
-     * Why are these Ip::Address instead of peer *?  Because a
-     * peer structure can become invalid during the peer selection
+     * Why are these Ip::Address instead of CachePeer *?  Because a
+     * CachePeer structure can become invalid during the CachePeer selection
      * phase, specifically after a reconfigure.  Thus we need to lookup
-     * the peer * based on the address when we are finally ready to
-     * reference the peer structure.
+     * the CachePeer * based on the address when we are finally ready to
+     * reference the CachePeer structure.
      */
 
     Ip::Address first_parent_miss;
 
     Ip::Address closest_parent_miss;
     /*
-     * ->hit can be peer* because it should only be
+     * ->hit can be CachePeer* because it should only be
      * accessed during the thread when it is set
      */
-    peer *hit;
+    CachePeer *hit;
     peer_t hit_type;
     ping_data ping;
     ACLChecklist *acl_checklist;
diff --git a/src/RefreshPattern.h b/src/RefreshPattern.h
new file mode 100644 (file)
index 0000000..cac2486
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef SQUID_REFRESHPATTERN_H_
+#define SQUID_REFRESHPATTERN_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.
+ *
+ */
+
+/// a representation of a refresh pattern. Currently a POD.
+class RefreshPattern
+{
+public:
+    const char *pattern;
+    regex_t compiled_pattern;
+    time_t min;
+    double pct;
+    time_t max;
+    RefreshPattern *next;
+
+    struct {
+        unsigned int icase:1;
+        unsigned int refresh_ims:1;
+        unsigned int store_stale:1;
+#if USE_HTTP_VIOLATIONS
+        unsigned int override_expire:1;
+        unsigned int override_lastmod:1;
+        unsigned int reload_into_ims:1;
+        unsigned int ignore_reload:1;
+        unsigned int ignore_no_cache:1;
+        unsigned int ignore_no_store:1;
+        unsigned int ignore_must_revalidate:1;
+        unsigned int ignore_private:1;
+        unsigned int ignore_auth:1;
+#endif
+    } flags;
+    int max_stale;
+};
+
+#endif /* SQUID_REFRESHPATTERN_H_ */
diff --git a/src/RegexList.cc b/src/RegexList.cc
new file mode 100644 (file)
index 0000000..d6b6f76
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ *
+ */
+
+#include "squid.h"
+#include "RegexList.h"
+
diff --git a/src/RegexList.h b/src/RegexList.h
new file mode 100644 (file)
index 0000000..840e773
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef SQUID_REGEXLIST_H_
+#define SQUID_REGEXLIST_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.
+ *
+ */
+
+/// list of regular expressions. Currently a POD.
+class RegexList
+{
+public:
+    int flags;
+    char *pattern;
+    regex_t regex;
+    RegexList *next;
+};
+
+#endif /* SQUID_REGEXLIST_H_ */
index d2622eeed4a2cf5bff5eefa9d9cce1ae6bc5bd98..dcd83cd888c0492a74029d18322cba1e51feea2c 100644 (file)
@@ -97,7 +97,7 @@ private:
     CBDATA_CLASS2(RemovalPurgeWalker);
 };
 
-extern RemovalPolicy *createRemovalPolicy(RemovalPolicySettings * settings);
+RemovalPolicy *createRemovalPolicy(RemovalPolicySettings * settings);
 
 typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist * args);
 
diff --git a/src/RequestFlags.cc b/src/RequestFlags.cc
new file mode 100644 (file)
index 0000000..43a1e7e
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * DEBUG: section 73    HTTP Request
+ * AUTHOR: Duane Wessels
+ *
+ * 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.
+ *
+ */
+
+#include "squid.h"
+#include "RequestFlags.h"
+
+
+// When adding new flags, please update cloneAdaptationImmune() as needed.
+// returns a partial copy of the flags that includes only those flags
+// that are safe for a related (e.g., ICAP-adapted) request to inherit
+RequestFlags
+RequestFlags::cloneAdaptationImmune() const
+{
+    // At the time of writing, all flags where either safe to copy after
+    // adaptation or were not set at the time of the adaptation. If there
+    // are flags that are different, they should be cleared in the clone.
+    return *this;
+}
diff --git a/src/RequestFlags.h b/src/RequestFlags.h
new file mode 100644 (file)
index 0000000..d0c0774
--- /dev/null
@@ -0,0 +1,150 @@
+#ifndef SQUID_REQUESTFLAGS_H_
+#define SQUID_REQUESTFLAGS_H_
+/*
+ * DEBUG: section 73    HTTP Request
+ * AUTHOR: Duane Wessels
+ *
+ * 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.
+ *
+ */
+
+/** request-related flags
+ *
+ * The bit-field contains both flags marking a request's current state,
+ * and flags requesting some processing to be done at a later stage.
+ * TODO: better distinguish the two cases.
+ */
+class RequestFlags
+{
+public:
+    RequestFlags() {
+        memset(this,0,sizeof(RequestFlags));
+    }
+
+    /** true if the response to this request may not be READ from cache */
+    bool noCache :1;
+    /** request is if-modified-since */
+    bool ims :1;
+    /** request is authenticated */
+    bool auth :1;
+    /** he response to the request may be stored in the cache */
+    bool cachable :1;
+    /** the request can be forwarded through the hierarchy */
+    bool hierarchical :1;
+    /** a loop was detected on this request */
+    bool loopDetected :1;
+    /** the connection can be kept alive */
+    bool proxyKeepalive :1;
+    /* this should be killed, also in httpstateflags */
+    bool proxying :1;
+    /** content has expired, need to refresh it */
+    bool refresh :1;
+    /** request was redirected by redirectors */
+    bool redirected :1;
+    /** the requested object needs to be validated. See client_side_reply.cc
+     * for further information.
+     */
+    bool needValidation :1;
+    /** whether we should fail if validation fails */
+    bool failOnValidationError :1;
+    /** reply is stale if it is a hit */
+    bool staleIfHit :1;
+    /** request to override no-cache directives
+     *
+     * always use noCacheHack() for reading.
+     * \note only meaningful if USE_HTTP_VIOLATIONS is defined at build time
+     */
+    bool nocacheHack :1;
+    /** this request is accelerated (reverse-proxy) */
+    bool accelerated :1;
+    /** if set, ignore Cache-Control headers */
+    bool ignoreCc :1;
+    /** set for intercepted requests */
+    bool intercepted :1;
+    /** set if the Host: header passed verification */
+    bool hostVerified :1;
+    /** request to spoof the client ip */
+    bool spoofClientIp :1;
+    /** set if the request is internal (\see ClientHttpRequest::flags.internal)*/
+    bool internal :1;
+    /** set for internally-generated requests */
+    //XXX this is set in in clientBeginRequest, but never tested.
+    bool internalClient :1;
+    /** if set, request to try very hard to keep the connection alive */
+    bool mustKeepalive :1;
+    /** set if the rquest wants connection oriented auth */
+    bool connectionAuth :1;
+    /** set if connection oriented auth can not be supported */
+    bool connectionAuthDisabled :1;
+    /** Request wants connection oriented auth */
+    // XXX This is set in clientCheckPinning but never tested
+    bool connectionProxyAuth :1;
+    /** set if the request was sent on a pinned connection */
+    bool pinned :1;
+    /** OK to reopen a failed pinned connection */
+    bool canRePin :1;
+    /** Authentication was already sent upstream (e.g. due tcp-level auth) */
+    bool authSent :1;
+    /** Deny direct forwarding unless overriden by always_direct
+     * Used in accelerator mode */
+    bool noDirect :1;
+    /** Reply with chunked transfer encoding */
+    bool chunkedReply :1;
+    /** set if stream error has occured */
+    bool streamError :1;
+    /** internal ssl-bump request to get server cert */
+    bool sslPeek :1;
+    /** set if X-Forwarded-For checking is complete
+     *
+     * do not read directly; use doneFollowXff for reading
+     */
+    bool done_follow_x_forwarded_for :1;
+    /** set for ssl-bumped requests */
+    bool sslBumped :1;
+    bool destinationIpLookedUp:1;
+    /** request to reset the TCP stream */
+    bool resetTcp:1;
+    /** set if the request is ranged */
+    bool isRanged :1;
+
+    /** clone the flags, resetting to default those which are not safe in
+     *  a related (e.g. ICAP-adapted) request.
+     */
+    RequestFlags cloneAdaptationImmune() const;
+
+    // if FOLLOW_X_FORWARDED_FOR is not set, we always return "done".
+    bool doneFollowXff() const {
+        return done_follow_x_forwarded_for || !FOLLOW_X_FORWARDED_FOR;
+    }
+
+    // if USE_HTTP_VIOLATIONS is not set, never allow this
+    bool noCacheHack() const {
+        return USE_HTTP_VIOLATIONS && nocacheHack;
+    }
+};
+
+#endif /* SQUID_REQUESTFLAGS_H_ */
index c9fe7dafa5c35c583f5d613acdb4285aa2a7eff8..a51b129697c51aa306aa0cdae04883740b9b10be 100644 (file)
@@ -53,6 +53,7 @@
 #include "adaptation/Answer.h"
 #include "adaptation/Iterator.h"
 #include "base/AsyncCall.h"
+#include "SquidConfig.h"
 #endif
 
 // implemented in client_side_reply.cc until sides have a common parent
index 99186675244d0d482db238bb0dac3614b2119256..818f3ccd9026917ee027f8eedb816157ae623f97 100644 (file)
@@ -43,6 +43,7 @@
 #endif
 
 class HttpMsg;
+class HttpReply;
 
 /**
  * ServerStateData is a common base for server-side classes such as
diff --git a/src/SnmpRequest.h b/src/SnmpRequest.h
new file mode 100644 (file)
index 0000000..c6c3a79
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef SQUID_SNMPREQUEST_H_
+#define SQUID_SNMPREQUEST_H_
+/*
+ * DEBUG: section 
+ * AUTHOR: 
+ *
+ * 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.
+ *
+ */
+
+#if SQUID_SNMP
+#include "snmp_session.h"
+
+// POD
+class SnmpRequest
+{
+public:
+    u_char *buf;
+    u_char *outbuf;
+    int len;
+    int sock;
+    long reqid;
+    int outlen;
+
+    Ip::Address from;
+
+    struct snmp_pdu *PDU;
+    ACLChecklist *acl_checklist;
+    u_char *community;
+
+    struct snmp_session session;
+};
+
+#endif /* SQUID_SNMP */
+
+#endif /* SQUID_SNMPREQUEST_H_ */
index 24104e239b5af07dc9a579135837e0a33f496d84..e1b951088602805f58899430b877dd0bb3d58dc6 100644 (file)
@@ -1,12 +1,7 @@
-/*
- * $Id$
- */
-
 #include "squid.h"
-#include "ip/Address.h"
-// just for the global definition of Config and Config2
-#include "structs.h"
+#include "SquidConfig.h"
 
 struct SquidConfig Config;
 
 struct SquidConfig2 Config2;
+
diff --git a/src/SquidConfig.h b/src/SquidConfig.h
new file mode 100644 (file)
index 0000000..bd3e9fb
--- /dev/null
@@ -0,0 +1,560 @@
+#ifndef SQUID_SQUIDCONFIG_H_
+#define SQUID_SQUIDCONFIG_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.
+ *
+ */
+
+#include "acl/AclAddress.h"
+#include "ClientDelayConfig.h"
+#include "DelayConfig.h"
+#include "HelperChildConfig.h"
+#include "HttpHeaderTools.h"
+#include "icmp/IcmpConfig.h"
+#include "ip/Address.h"
+#include "RefCount.h"
+#include "YesNoNone.h"
+
+#if USE_SSL
+#include <openssl/ssl.h>
+class sslproxy_cert_sign;
+class sslproxy_cert_adapt;
+#endif
+
+class acl_access;
+class acl_size_t;
+class AclDenyInfoList;
+namespace Mgr {
+class ActionPasswordList;
+} // namespace Mgr
+class CustomLog;
+class CpuAffinityMap;
+class external_acl;
+class HeaderManglers;
+class RefreshPattern;
+class RemovalPolicySettings;
+class SwapDir;
+
+namespace AnyP {
+class PortCfg;
+}
+
+/// the representation of the configuration. POD.
+class SquidConfig
+{
+public:
+    struct {
+        /* These should be for the Store::Root instance.
+        * this needs pluggable parsing to be done smoothly.
+        */
+        int highWaterMark;
+        int lowWaterMark;
+    } Swap;
+
+    YesNoNone memShared; ///< whether the memory cache is shared among workers
+    size_t memMaxSize;
+
+    struct {
+        int64_t min;
+        int pct;
+        int64_t max;
+    } quickAbort;
+    int64_t readAheadGap;
+    RemovalPolicySettings *replPolicy;
+    RemovalPolicySettings *memPolicy;
+#if USE_HTTP_VIOLATIONS
+    time_t negativeTtl;
+#endif
+    time_t maxStale;
+    time_t negativeDnsTtl;
+    time_t positiveDnsTtl;
+    time_t shutdownLifetime;
+    time_t backgroundPingRate;
+
+    struct {
+        time_t read;
+        time_t write;
+        time_t lifetime;
+        time_t connect;
+        time_t forward;
+        time_t peer_connect;
+        time_t request;
+        time_t clientIdlePconn;
+        time_t serverIdlePconn;
+        time_t siteSelect;
+        time_t deadPeer;
+        int icp_query;      /* msec */
+        int icp_query_max;  /* msec */
+        int icp_query_min;  /* msec */
+        int mcast_icp_query;    /* msec */
+
+#if !USE_DNSHELPER
+        time_msec_t idns_retransmit;
+        time_msec_t idns_query;
+#endif
+
+    } Timeout;
+    size_t maxRequestHeaderSize;
+    int64_t maxRequestBodySize;
+    int64_t maxChunkedRequestBodySize;
+    size_t maxRequestBufferSize;
+    size_t maxReplyHeaderSize;
+    acl_size_t *ReplyBodySize;
+
+    struct {
+        unsigned short icp;
+#if USE_HTCP
+
+        unsigned short htcp;
+#endif
+#if SQUID_SNMP
+
+        unsigned short snmp;
+#endif
+    } Port;
+
+    struct {
+        AnyP::PortCfg *http;
+#if USE_SSL
+        AnyP::PortCfg *https;
+#endif
+    } Sockaddr;
+#if SQUID_SNMP
+
+    struct {
+        char *configFile;
+        char *agentInfo;
+    } Snmp;
+#endif
+#if USE_WCCP
+
+    struct {
+        Ip::Address router;
+        Ip::Address address;
+        int version;
+    } Wccp;
+#endif
+#if USE_WCCPv2
+
+    struct {
+        Ip::Address_list *router;
+        Ip::Address address;
+        int forwarding_method;
+        int return_method;
+        int assignment_method;
+        int weight;
+        int rebuildwait;
+        void *info;
+    } Wccp2;
+#endif
+
+#if USE_ICMP
+    IcmpConfig pinger;
+#endif
+
+    char *as_whois_server;
+
+    struct {
+        char *store;
+        char *swap;
+        CustomLog *accesslogs;
+#if ICAP_CLIENT
+        CustomLog *icaplogs;
+#endif
+        int rotateNumber;
+    } Log;
+    char *adminEmail;
+    char *EmailFrom;
+    char *EmailProgram;
+    char *effectiveUser;
+    char *visible_appname_string;
+    char *effectiveGroup;
+
+    struct {
+#if USE_DNSHELPER
+        char *dnsserver;
+#endif
+
+        wordlist *redirect;
+#if USE_UNLINKD
+
+        char *unlinkd;
+#endif
+
+        char *diskd;
+#if USE_SSL
+
+        char *ssl_password;
+#endif
+
+    } Program;
+#if USE_DNSHELPER
+    HelperChildConfig dnsChildren;
+#endif
+
+    HelperChildConfig redirectChildren;
+    time_t authenticateGCInterval;
+    time_t authenticateTTL;
+    time_t authenticateIpTTL;
+
+    struct {
+        char *surrogate_id;
+    } Accel;
+    char *appendDomain;
+    size_t appendDomainLen;
+    char *pidFilename;
+    char *netdbFilename;
+    char *mimeTablePathname;
+    char *etcHostsPath;
+    char *visibleHostname;
+    char *uniqueHostname;
+    wordlist *hostnameAliases;
+    char *errHtmlText;
+
+    struct {
+        char *host;
+        char *file;
+        time_t period;
+        unsigned short port;
+    } Announce;
+
+    struct {
+
+        Ip::Address udp_incoming;
+        Ip::Address udp_outgoing;
+#if SQUID_SNMP
+        Ip::Address snmp_incoming;
+        Ip::Address snmp_outgoing;
+#endif
+        /* FIXME INET6 : this should really be a CIDR value */
+        Ip::Address client_netmask;
+    } Addrs;
+    size_t tcpRcvBufsz;
+    size_t udpMaxHitObjsz;
+    wordlist *hierarchy_stoplist;
+    wordlist *mcast_group_list;
+    wordlist *dns_nameservers;
+    CachePeer *peers;
+    int npeers;
+
+    struct {
+        int size;
+        int low;
+        int high;
+    } ipcache;
+
+    struct {
+        int size;
+    } fqdncache;
+    int minDirectHops;
+    int minDirectRtt;
+    Mgr::ActionPasswordList *passwd_list;
+
+    struct {
+        int objectsPerBucket;
+        int64_t avgObjectSize;
+        int64_t maxObjectSize;
+        int64_t minObjectSize;
+        size_t maxInMemObjSize;
+    } Store;
+
+    struct {
+        int high;
+        int low;
+        time_t period;
+    } Netdb;
+
+    struct {
+        int log_udp;
+        int res_defnames;
+        int anonymizer;
+        int client_db;
+        int query_icmp;
+        int icp_hit_stale;
+        int buffered_logs;
+        int common_log;
+        int log_mime_hdrs;
+        int log_fqdn;
+        int announce;
+        int mem_pools;
+        int test_reachability;
+        int half_closed_clients;
+        int refresh_all_ims;
+#if USE_HTTP_VIOLATIONS
+
+        int reload_into_ims;
+#endif
+
+        int offline;
+        int redir_rewrites_host;
+        int prefer_direct;
+        int nonhierarchical_direct;
+        int strip_query_terms;
+        int redirector_bypass;
+        int ignore_unknown_nameservers;
+        int client_pconns;
+        int server_pconns;
+        int error_pconns;
+#if USE_CACHE_DIGESTS
+
+        int digest_generation;
+#endif
+
+        int ie_refresh;
+        int vary_ignore_expire;
+        int pipeline_prefetch;
+        int surrogate_is_remote;
+        int request_entities;
+        int detect_broken_server_pconns;
+        int balance_on_multiple_ip;
+        int relaxed_header_parser;
+        int check_hostnames;
+        int allow_underscore;
+        int via;
+        int emailErrData;
+        int httpd_suppress_version_string;
+        int global_internal_static;
+
+#if FOLLOW_X_FORWARDED_FOR
+        int acl_uses_indirect_client;
+        int delay_pool_uses_indirect_client;
+        int log_uses_indirect_client;
+#if LINUX_NETFILTER
+        int tproxy_uses_indirect_client;
+#endif
+#endif /* FOLLOW_X_FORWARDED_FOR */
+
+        int WIN32_IpAddrChangeMonitor;
+        int memory_cache_first;
+        int memory_cache_disk;
+        int hostStrictVerify;
+        int client_dst_passthru;
+    } onoff;
+
+    int forward_max_tries;
+    int connect_retries;
+
+    class ACL *aclList;
+
+    struct {
+        acl_access *http;
+        acl_access *adapted_http;
+        acl_access *icp;
+        acl_access *miss;
+        acl_access *NeverDirect;
+        acl_access *AlwaysDirect;
+        acl_access *ASlists;
+        acl_access *noCache;
+        acl_access *log;
+#if SQUID_SNMP
+
+        acl_access *snmp;
+#endif
+#if USE_HTTP_VIOLATIONS
+        acl_access *brokenPosts;
+#endif
+        acl_access *redirector;
+        acl_access *reply;
+        AclAddress *outgoing_address;
+#if USE_HTCP
+
+        acl_access *htcp;
+        acl_access *htcp_clr;
+#endif
+
+#if USE_SSL
+        acl_access *ssl_bump;
+#endif
+#if FOLLOW_X_FORWARDED_FOR
+        acl_access *followXFF;
+#endif /* FOLLOW_X_FORWARDED_FOR */
+
+#if ICAP_CLIENT
+        acl_access* icap;
+#endif
+    } accessList;
+    AclDenyInfoList *denyInfoList;
+
+    struct {
+        size_t list_width;
+        int list_wrap;
+        char *anon_user;
+        int passive;
+        int epsv_all;
+        int epsv;
+        int eprt;
+        int sanitycheck;
+        int telnet;
+    } Ftp;
+    RefreshPattern *Refresh;
+
+    struct _cacheSwap {
+        RefCount<SwapDir> *swapDirs;
+        int n_allocated;
+        int n_configured;
+        /// number of disk processes required to support all cache_dirs
+        int n_strands;
+    } cacheSwap;
+    /*
+     * I'm sick of having to keep doing this ..
+     */
+#define INDEXSD(i)   (Config.cacheSwap.swapDirs[(i)].getRaw())
+
+    struct {
+        char *directory;
+        int use_short_names;
+    } icons;
+    char *errorDirectory;
+#if USE_ERR_LOCALES
+    char *errorDefaultLanguage;
+    int errorLogMissingLanguages;
+#endif
+    char *errorStylesheet;
+
+    struct {
+        int onerror;
+    } retry;
+
+    struct {
+        int64_t limit;
+    } MemPools;
+#if USE_DELAY_POOLS
+
+    DelayConfig Delay;
+    ClientDelayConfig ClientDelay;
+#endif
+
+    struct {
+        struct {
+            int average;
+            int min_poll;
+        } dns, udp, tcp;
+    } comm_incoming;
+    int max_open_disk_fds;
+    int uri_whitespace;
+    acl_size_t *rangeOffsetLimit;
+#if MULTICAST_MISS_STREAM
+
+    struct {
+
+        Ip::Address addr;
+        int ttl;
+        unsigned short port;
+        char *encode_key;
+    } mcast_miss;
+#endif
+
+    /// request_header_access and request_header_replace
+    HeaderManglers *request_header_access;
+    /// reply_header_access and reply_header_replace
+    HeaderManglers *reply_header_access;
+    ///request_header_add access list
+    HeaderWithAclList *request_header_add;
+    char *coredump_dir;
+    char *chroot_dir;
+#if USE_CACHE_DIGESTS
+
+    struct {
+        int bits_per_entry;
+        time_t rebuild_period;
+        time_t rewrite_period;
+        size_t swapout_chunk_size;
+        int rebuild_chunk_percentage;
+    } digest;
+#endif
+#if USE_SSL
+
+    struct {
+        int unclean_shutdown;
+        char *ssl_engine;
+    } SSL;
+#endif
+
+    wordlist *ext_methods;
+
+    struct {
+        int high_rptm;
+        int high_pf;
+        size_t high_memory;
+    } warnings;
+    char *store_dir_select_algorithm;
+    int sleep_after_fork;   /* microseconds */
+    time_t minimum_expiry_time; /* seconds */
+    external_acl *externalAclHelperList;
+
+#if USE_SSL
+
+    struct {
+        char *cert;
+        char *key;
+        int version;
+        char *options;
+        char *cipher;
+        char *cafile;
+        char *capath;
+        char *crlfile;
+        char *flags;
+        acl_access *cert_error;
+        SSL_CTX *sslContext;
+        sslproxy_cert_sign *cert_sign;
+        sslproxy_cert_adapt *cert_adapt;
+    } ssl_client;
+#endif
+
+    char *accept_filter;
+    int umask;
+    int max_filedescriptors;
+    int workers;
+    CpuAffinityMap *cpuAffinityMap;
+
+#if USE_LOADABLE_MODULES
+    wordlist *loadable_module_names;
+#endif
+
+    int client_ip_max_connections;
+
+    struct {
+        int v4_first;       ///< Place IPv4 first in the order of DNS results.
+        ssize_t packet_max; ///< maximum size EDNS advertised for DNS replies.
+    } dns;
+
+};
+
+extern SquidConfig Config;
+
+struct SquidConfig2 {
+    struct {
+        int enable_purge;
+        int mangle_request_headers;
+    } onoff;
+    uid_t effectiveUserID;
+    gid_t effectiveGroupID;
+};
+
+extern SquidConfig2 Config2;
+
+#endif /* SQUID_SQUIDCONFIG_H_ */
index e5b82a59a38df1da197ad13e84bc329ba6328b04..83cc516cf6a0822f8e58e01f7c699c842b87eeab 100644 (file)
@@ -7,16 +7,16 @@ class Address;
 }
 
 // generic DNS API
-extern void dnsInit(void);
-extern void dnsShutdown(void);
+void dnsInit(void);
+void dnsShutdown(void);
 
 #if USE_DNSHELPER
 // external DNS helper API
-extern void dnsSubmit(const char *lookup, HLPCB * callback, void *data);
+void dnsSubmit(const char *lookup, HLPCB * callback, void *data);
 #else
 // internal DNS client API
-extern void idnsALookup(const char *, IDNSCB *, void *);
-extern void idnsPTRLookup(const Ip::Address &, IDNSCB *, void *);
+void idnsALookup(const char *, IDNSCB *, void *);
+void idnsPTRLookup(const Ip::Address &, IDNSCB *, void *);
 #endif
 
 #endif /* SQUID_DNS_H */
index 30fcd344a00ec0a6e1cbb967a2131c6559aebcdf..61396d16e61ff84314c3a7bb277443ee3e860cab 100644 (file)
@@ -36,13 +36,13 @@ namespace Ip
 {
 class Address;
 }
-extern pid_t ipcCreate(int type,
-                       const char *prog,
-                       const char *const args[],
-                       const char *name,
-                       Ip::Address &local_addr,
-                       int *rfd,
-                       int *wfd,
-                       void **hIpc);
+pid_t ipcCreate(int type,
+                const char *prog,
+                const char *const args[],
+                const char *name,
+                Ip::Address &local_addr,
+                int *rfd,
+                int *wfd,
+                void **hIpc);
 
 #endif /* SQUID_SQUIDIPC_H_ */
index ca8943aac69f07ebe04e2014c4944a29388c976e..ca30fba6909235bb6b635fd9b2f706c5016a4bb6 100644 (file)
@@ -39,7 +39,7 @@ public:
     link_list *next;
 };
 
-extern void linklistPush(link_list **, void *);
-extern void *linklistShift(link_list **);
+void linklistPush(link_list **, void *);
+void *linklistShift(link_list **);
 
 #endif /* SQUID_SQUIDLIST_H_ */
index c31a13a08bbc0d49b096b40d70f00efb87f84732..dfa714cec435ba4bbdb976817e34c32ca6407742 100644 (file)
@@ -5,11 +5,11 @@
 namespace Math
 {
 
-extern int intPercent(const int a, const int b);
-extern int64_t int64Percent(const int64_t a, const int64_t b);
-extern double doublePercent(const double, const double);
-extern int intAverage(const int, const int, int, const int);
-extern double doubleAverage(const double, const double, int, const int);
+int intPercent(const int a, const int b);
+int64_t int64Percent(const int64_t a, const int64_t b);
+double doublePercent(const double, const double);
+int intAverage(const int, const int, int, const int);
+double doubleAverage(const double, const double, int, const int);
 
 } // namespace Math
 
index 8cb267c5909204e40db68a45fa1e1f41034f01dc..41d060eaa44cfcfade8853a79d0957fe1cb088f2 100644 (file)
@@ -181,9 +181,9 @@ _SQUID_INLINE_ bool operator<(const String &a, const String &b);
 #include "String.cci"
 #endif
 
-extern const char *checkNullString(const char *p);
-extern int stringHasWhitespace(const char *);
-extern int stringHasCntl(const char *);
-extern char *strwordtok(char *buf, char **t);
+const char *checkNullString(const char *p);
+int stringHasWhitespace(const char *);
+int stringHasCntl(const char *);
+char *strwordtok(char *buf, char **t);
 
 #endif /* SQUID_STRING_H */
index 9f1d46c4bbfeba186bfb2c48835ce2ff0c615c51..f84e97d99362422a57b29571a54743d01090ae0d 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include "MemObject.h"
+#include "HttpReply.h"
 
 /**
  \retval true  Store contains 0 bytes of data.
index 5fedd563bdb577162a243eb7ea019131181ac536..648b730094fe7f6135f95b13f31781e5ffacca9a 100644 (file)
@@ -37,8 +37,9 @@
 
 #include "comm/forward.h"
 #include "CommRead.h"
+#include "hash.h"
+#include "HttpReply.h"
 #include "HttpRequestMethod.h"
-#include "Packer.h"
 #include "Range.h"
 #include "RefCount.h"
 #include "RemovalPolicy.h"
@@ -56,6 +57,8 @@
 class AsyncCall;
 class HttpRequest;
 class MemObject;
+class Packer;
+class RequestFlags;
 class StoreClient;
 class StoreSearch;
 class SwapDir;
@@ -360,62 +363,62 @@ private:
 typedef RefCount<Store> StorePointer;
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN size_t storeEntryInUse();
+size_t storeEntryInUse();
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN const char *storeEntryFlags(const StoreEntry *);
+const char *storeEntryFlags(const StoreEntry *);
 
 /// \ingroup StoreAPI
-extern void storeEntryReplaceObject(StoreEntry *, HttpReply *);
+void storeEntryReplaceObject(StoreEntry *, HttpReply *);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method);
+StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN StoreEntry *storeGetPublicByRequest(HttpRequest * request);
+StoreEntry *storeGetPublicByRequest(HttpRequest * request);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method);
+StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_flags, const HttpRequestMethod&);
+StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeInit(void);
+void storeInit(void);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeConfigure(void);
+void storeConfigure(void);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeFreeMemory(void);
+void storeFreeMemory(void);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN int expiresMoreThan(time_t, time_t);
+int expiresMoreThan(time_t, time_t);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeAppendPrintf(StoreEntry *, const char *,...) PRINTF_FORMAT_ARG2;
+void storeAppendPrintf(StoreEntry *, const char *,...) PRINTF_FORMAT_ARG2;
 
 /// \ingroup StoreAPI
-extern void storeAppendVPrintf(StoreEntry *, const char *, va_list ap);
+void storeAppendVPrintf(StoreEntry *, const char *, va_list ap);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN int storeTooManyDiskFilesOpen(void);
+int storeTooManyDiskFilesOpen(void);
 
 class SwapDir;
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeHeapPositionUpdate(StoreEntry *, SwapDir *);
+void storeHeapPositionUpdate(StoreEntry *, SwapDir *);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeSwapFileNumberSet(StoreEntry * e, sfileno filn);
+void storeSwapFileNumberSet(StoreEntry * e, sfileno filn);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeFsInit(void);
+void storeFsInit(void);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeFsDone(void);
+void storeFsDone(void);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeReplAdd(const char *, REMOVALPOLICYCREATE *);
+void storeReplAdd(const char *, REMOVALPOLICYCREATE *);
 
 /// \ingroup StoreAPI
 extern FREE destroyStoreEntry;
@@ -424,10 +427,10 @@ extern FREE destroyStoreEntry;
  \ingroup StoreAPI
  \todo should be a subclass of Packer perhaps ?
  */
-SQUIDCEXTERN void packerToStoreInit(Packer * p, StoreEntry * e);
+void packerToStoreInit(Packer * p, StoreEntry * e);
 
 /// \ingroup StoreAPI
-SQUIDCEXTERN void storeGetMemSpace(int size);
+void storeGetMemSpace(int size);
 
 #if _USE_INLINE_
 #include "Store.cci"
index 1e9d87d472875cd1a598a4d62cd88a260ad2e5a1..e6f1001f507be9c4f066595f89a6d19fec11f0c0 100644 (file)
@@ -125,11 +125,11 @@ private:
     CBDATA_CLASS(store_client);
 };
 
-extern void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *);
-extern store_client* storeClientListAdd(StoreEntry * e, void *data);
-extern int storeClientCopyPending(store_client *, StoreEntry * e, void *data);
-extern int storeUnregister(store_client * sc, StoreEntry * e, void *data);
-extern int storePendingNClients(const StoreEntry * e);
-extern int storeClientIsThisAClient(store_client * sc, void *someClient);
+void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *);
+store_client* storeClientListAdd(StoreEntry * e, void *data);
+int storeClientCopyPending(store_client *, StoreEntry * e, void *data);
+int storeUnregister(store_client * sc, StoreEntry * e, void *data);
+int storePendingNClients(const StoreEntry * e);
+int storeClientIsThisAClient(store_client * sc, void *someClient);
 
 #endif /* SQUID_STORECLIENT_H */
index 829ae9f1eaaffae1787e47ce74b8ee95fdcb7e18..1cefb46160b8abf47dbc4687862fc0cc1e3bd4bc 100644 (file)
@@ -35,9 +35,9 @@
 
 class String;
 
-extern void strListAdd(String * str, const char *item, char del);
-extern int strListIsMember(const String * str, const char *item, char del);
-extern int strListIsSubstr(const String * list, const char *s, char del);
-extern int strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos);
+void strListAdd(String * str, const char *item, char del);
+int strListIsMember(const String * str, const char *item, char del);
+int strListIsSubstr(const String * list, const char *s, char del);
+int strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos);
 
 #endif /* SQUID_STRLIST_H_ */
index b1812ba546c38ddd06dabbb6886e4b1780e8bb95..7061dd4f603cc1428b1f2430daee46c31748612c 100644 (file)
@@ -36,6 +36,7 @@
 #include "ConfigOption.h"
 #include "globals.h"
 #include "Parsing.h"
+#include "SquidConfig.h"
 #include "StoreFileSystem.h"
 #include "SwapDir.h"
 #include "tools.h"
index 8006e73ac8b4a5ffb93e73b774b0499bd71334ff..4178fb2206c39179d2dbb62778ecf953b4519a9c 100644 (file)
@@ -30,6 +30,7 @@
 #ifndef SQUID_SWAPDIR_H
 #define SQUID_SWAPDIR_H
 
+#include "SquidConfig.h"
 #include "Store.h"
 #include "StoreIOState.h"
 
@@ -97,25 +98,25 @@ private:
 };
 
 /* migrating from the Config based list of swapdirs */
-extern void allocate_new_swapdir(SquidConfig::_cacheSwap *);
-extern void free_cachedir(SquidConfig::_cacheSwap * swap);
-SQUIDCEXTERN OBJH storeDirStats;
-SQUIDCEXTERN char *storeDirSwapLogFile(int, const char *);
-SQUIDCEXTERN char *storeSwapFullPath(int, char *);
-SQUIDCEXTERN char *storeSwapSubSubDir(int, char *);
-SQUIDCEXTERN const char *storeSwapPath(int);
-SQUIDCEXTERN int storeDirWriteCleanLogs(int reopen);
-SQUIDCEXTERN STDIRSELECT *storeDirSelectSwapDir;
-SQUIDCEXTERN int storeVerifySwapDirs(void);
-SQUIDCEXTERN void storeDirCloseSwapLogs(void);
-SQUIDCEXTERN void storeDirCloseTmpSwapLog(int dirn);
-SQUIDCEXTERN void storeDirDiskFull(sdirno);
-SQUIDCEXTERN void storeDirOpenSwapLogs(void);
-SQUIDCEXTERN void storeDirSwapLog(const StoreEntry *, int op);
-SQUIDCEXTERN void storeDirLRUDelete(StoreEntry *);
-SQUIDCEXTERN void storeDirLRUAdd(StoreEntry *);
-SQUIDCEXTERN int storeDirGetBlkSize(const char *path, int *blksize);
-SQUIDCEXTERN int storeDirGetUFSStats(const char *, int *, int *, int *, int *);
+void allocate_new_swapdir(SquidConfig::_cacheSwap *);
+void free_cachedir(SquidConfig::_cacheSwap * swap);
+extern OBJH storeDirStats;
+char *storeDirSwapLogFile(int, const char *);
+char *storeSwapFullPath(int, char *);
+char *storeSwapSubSubDir(int, char *);
+const char *storeSwapPath(int);
+int storeDirWriteCleanLogs(int reopen);
+extern STDIRSELECT *storeDirSelectSwapDir;
+int storeVerifySwapDirs(void);
+void storeDirCloseSwapLogs(void);
+void storeDirCloseTmpSwapLog(int dirn);
+void storeDirDiskFull(sdirno);
+void storeDirOpenSwapLogs(void);
+void storeDirSwapLog(const StoreEntry *, int op);
+void storeDirLRUDelete(StoreEntry *);
+void storeDirLRUAdd(StoreEntry *);
+int storeDirGetBlkSize(const char *path, int *blksize);
+int storeDirGetUFSStats(const char *, int *, int *, int *, int *);
 
 /// manages a single cache_dir
 class SwapDir : public Store
index 727279a8b15204f84e23437902926806d0b94247..de33fab249f80d7aa43fb12042dc0510c4e9706d 100644 (file)
--- a/src/URL.h
+++ b/src/URL.h
@@ -79,20 +79,20 @@ MEMPROXY_CLASS_INLINE(URL);
 class HttpRequest;
 class HttpRequestMethod;
 
-extern AnyP::ProtocolType urlParseProtocol(const char *, const char *e = NULL);
-extern void urlInitialize(void);
-extern HttpRequest *urlParse(const HttpRequestMethod&, char *, HttpRequest *request = NULL);
-extern const char *urlCanonical(HttpRequest *);
-extern char *urlCanonicalClean(const HttpRequest *);
-extern const char *urlCanonicalFakeHttps(const HttpRequest * request);
-extern bool urlIsRelative(const char *);
-extern char *urlMakeAbsolute(const HttpRequest *, const char *);
-extern char *urlRInternal(const char *host, unsigned short port, const char *dir, const char *name);
-extern char *urlInternal(const char *dir, const char *name);
-extern int matchDomainName(const char *host, const char *domain);
-extern int urlCheckRequest(const HttpRequest *);
-extern int urlDefaultPort(AnyP::ProtocolType p);
-extern char *urlHostname(const char *url);
-extern void urlExtMethodConfigure(void);
+AnyP::ProtocolType urlParseProtocol(const char *, const char *e = NULL);
+void urlInitialize(void);
+HttpRequest *urlParse(const HttpRequestMethod&, char *, HttpRequest *request = NULL);
+const char *urlCanonical(HttpRequest *);
+char *urlCanonicalClean(const HttpRequest *);
+const char *urlCanonicalFakeHttps(const HttpRequest * request);
+bool urlIsRelative(const char *);
+char *urlMakeAbsolute(const HttpRequest *, const char *);
+char *urlRInternal(const char *host, unsigned short port, const char *dir, const char *name);
+char *urlInternal(const char *dir, const char *name);
+int matchDomainName(const char *host, const char *domain);
+int urlCheckRequest(const HttpRequest *);
+int urlDefaultPort(AnyP::ProtocolType p);
+char *urlHostname(const char *url);
+void urlExtMethodConfigure(void);
 
 #endif /* SQUID_SRC_URL_H_H */
index 595182a250ff0db8a02ce536f7c97e12fd360704..69fbe868974b9ad2b42926e34af24544ea0b0c0e 100644 (file)
  */
 
 #if _SQUID_WINDOWS_
-extern int WIN32_Subsystem_Init(int *, char ***);
-extern void WIN32_sendSignal(int);
-extern void WIN32_SetServiceCommandLine(void);
-extern void WIN32_InstallService(void);
-extern void WIN32_RemoveService(void);
-extern int SquidMain(int, char **);
+int WIN32_Subsystem_Init(int *, char ***);
+void WIN32_sendSignal(int);
+void WIN32_SetServiceCommandLine(void);
+void WIN32_InstallService(void);
+void WIN32_RemoveService(void);
+int SquidMain(int, char **);
 #else /* _SQUID_WINDOWS_ */
 inline int WIN32_Subsystem_Init(int *foo, char ***bar) {return 0; } /* NOP */
 inline void WIN32_sendSignal(int foo) { return; } /* NOP */
diff --git a/src/YesNoNone.cc b/src/YesNoNone.cc
new file mode 100644 (file)
index 0000000..ec977a9
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ *
+ */
+
+#include "squid.h"
+#include "YesNoNone.h"
+
+YesNoNone::operator void*() const
+{
+    assert(option != 0); // must call configure() first
+    return option > 0 ? (void*)this : NULL;
+}
+
+void
+YesNoNone::configure(bool beSet)
+{
+    option = beSet ? +1 : -1;
+}
diff --git a/src/YesNoNone.h b/src/YesNoNone.h
new file mode 100644 (file)
index 0000000..c655984
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef SQUID_YESNONONE_H_
+#define SQUID_YESNONONE_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.
+ *
+ */
+
+/// Used for boolean enabled/disabled options with complex default logic.
+/// Allows Squid to compute the right default after configuration.
+/// Checks that not-yet-defined option values are not used.
+class YesNoNone
+{
+// TODO: generalize to non-boolean option types
+public:
+    YesNoNone(): option(0) {}
+
+    /// returns true iff enabled; asserts if the option has not been configured
+    operator void *() const; // TODO: use a fancy/safer version of the operator
+
+    /// enables or disables the option;
+    void configure(bool beSet);
+
+    /// whether the option was enabled or disabled, by user or Squid
+    bool configured() const { return option != 0; }
+
+private:
+    enum { optUnspecified = -1, optDisabled = 0, optEnabled = 1 };
+    int option; ///< configured value or zero
+};
+
+#endif /* SQUID_YESNONONE_H_ */
index cf517d1421660569a4db5f1c1b58896c533b2643..11245fc0ec6969d299b91e1f0b2f6f493620b142 100644 (file)
@@ -37,6 +37,7 @@
 #include "Debug.h"
 #include "dlink.h"
 #include "globals.h"
+#include "SquidConfig.h"
 
 const char *AclMatchedName = NULL;
 
index bc3e70f7e66ec472f4579d68b8c5e9f425acccdb..8919e51d57aa48f26d238afbf52b7b6111ad3f43 100644 (file)
@@ -38,7 +38,6 @@
 #include "defines.h"
 #include "dlink.h"
 #include "MemPool.h"
-#include "structs.h"
 
 #if HAVE_OSTREAM
 #include <ostream>
@@ -46,6 +45,7 @@
 
 class ConfigParser;
 class ACLChecklist;
+class ACLList;
 
 /// \ingroup ACLAPI
 class ACL
diff --git a/src/acl/AclAddress.cc b/src/acl/AclAddress.cc
new file mode 100644 (file)
index 0000000..9818d68
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+#include "squid.h"
+#include "AclAddress.h"
+
+//TODO: fill in
diff --git a/src/acl/AclAddress.h b/src/acl/AclAddress.h
new file mode 100644 (file)
index 0000000..ead7b36
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef ACLADDRESS_H_
+#define ACLADDRESS_H_
+#include "Acl.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.
+ */
+
+#include "ip/Address.h"
+#include "acl/Acl.h"
+
+/// list of address-based ACLs. Currently a POD.
+class AclAddress
+{
+public:
+    AclAddress *next;
+    ACLList *aclList;
+
+    Ip::Address addr;
+};
+
+#endif /* ACLADDRESS_H_ */
diff --git a/src/acl/AclDenyInfoList.h b/src/acl/AclDenyInfoList.h
new file mode 100644 (file)
index 0000000..b2798e3
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef SQUID_ACLDENYINFOLIST_H_
+#define SQUID_ACLDENYINFOLIST_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.
+ *
+ */
+
+#include "err_type.h"
+
+class AclNameList;
+
+/// deny_info representation. Currently a POD.
+class AclDenyInfoList
+{
+public:
+    err_type err_page_id;
+    char *err_page_name;
+    AclNameList *acl_list;
+    AclDenyInfoList *next;
+};
+
+#endif /* SQUID_ACLDENYINFOLIST_H_ */
diff --git a/src/acl/AclNameList.h b/src/acl/AclNameList.h
new file mode 100644 (file)
index 0000000..5acbc7b
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef SQUID_ACL_ACLNAMELIST_H_
+#define SQUID_ACL_ACLNAMELIST_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.
+ *
+ */
+
+#include "defines.h"
+
+/// list of name-based ACLs. Currently a POD.
+class AclNameList
+{
+public:
+    char name[ACL_NAME_SZ];
+    AclNameList *next;
+};
+// TODO: convert to a std::list<string>
+
+#endif /* SQUID_ACLNAMELIST_H_ */
index 49aa4858fe4992de5a817efb6244350afc9da168..f53420b440c0d56c65e22a6c1f8efcccc55784bd 100644 (file)
  */
 
 #include "squid.h"
-#include "mgr/Registration.h"
-#include "radix.h"
-#include "HttpRequest.h"
-#include "StoreClient.h"
-#include "Store.h"
 #include "acl/Acl.h"
 #include "acl/Asn.h"
 #include "acl/Checklist.h"
-#include "acl/SourceAsn.h"
 #include "acl/DestinationAsn.h"
 #include "acl/DestinationIp.h"
+#include "acl/SourceAsn.h"
 #include "cache_cf.h"
+#include "forward.h"
 #include "HttpReply.h"
+#include "HttpRequest.h"
 #include "ipcache.h"
-#include "forward.h"
+#include "mgr/Registration.h"
+#include "radix.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
+#include "Store.h"
+#include "StoreClient.h"
 #include "StoreClient.h"
 #include "wordlist.h"
 
@@ -247,7 +249,7 @@ asnCacheStart(int as)
     asState->request = HTTPMSGLOCK(req);
 
     if ((e = storeGetPublic(asres, METHOD_GET)) == NULL) {
-        e = storeCreateEntry(asres, asres, request_flags(), METHOD_GET);
+        e = storeCreateEntry(asres, asres, RequestFlags(), METHOD_GET);
         asState->sc = storeClientListAdd(e, asState);
         FwdState::fwdStart(Comm::ConnectionPointer(), e, asState->request);
     } else {
@@ -639,7 +641,7 @@ ACLDestinationASNStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist
 
         return 0;
 
-    } else if (!checklist->request->flags.destinationIPLookedUp()) {
+    } else if (!checklist->request->flags.destinationIpLookedUp) {
         /* No entry in cache, lookup not attempted */
         /* XXX FIXME: allow accessing the acl name here */
         debugs(28, 3, "asnMatchAcl: Can't yet compare '" << "unknown" /*name*/ << "' ACL for '" << checklist->request->GetHost() << "'");
index f272ec3fda65fa1ecd4cef5c66cc784c4eaeb40c..c49e8622296d281b61db7fef92d296f7d3c24ff4 100644 (file)
 #include "acl/Checklist.h"
 #include "ip/Address.h"
 
-SQUIDCEXTERN int asnMatchIp(CbDataList<int> *, Ip::Address &);
+int asnMatchIp(CbDataList<int> *, Ip::Address &);
 
 /// \ingroup ACLAPI
-SQUIDCEXTERN void asnInit(void);
+void asnInit(void);
 
 /// \ingroup ACLAPI
-SQUIDCEXTERN void asnFreeMemory(void);
+void asnFreeMemory(void);
 
 /// \ingroup ACLAPI
 class ACLASN : public ACLData<Ip::Address>
index 5aeb762f687170ed964c9f0d03060f7b44c1fb99..ab2967b112187a9c0ab0327c8bb0ebb834fed2c1 100644 (file)
@@ -37,7 +37,7 @@
 #include "client_side.h"
 #include "comm/Connection.h"
 #include "HttpRequest.h"
-#include "structs.h"
+#include "SquidConfig.h"
 
 char const *
 ACLDestinationIP::typeString() const
@@ -55,7 +55,7 @@ ACLDestinationIP::match(ACLChecklist *cl)
     // To resolve this we will force DIRECT and only to the original client destination.
     // In which case, we also need this ACL to accurately match the destination
     if (Config.onoff.client_dst_passthru && checklist->request &&
-            (checklist->request->flags.intercepted || checklist->request->flags.spoof_client_ip)) {
+            (checklist->request->flags.intercepted || checklist->request->flags.spoofClientIp)) {
         assert(checklist->conn() && checklist->conn()->clientConnection != NULL);
         return ACLIP::match(checklist->conn()->clientConnection->local);
     }
@@ -71,7 +71,7 @@ ACLDestinationIP::match(ACLChecklist *cl)
         }
 
         return 0;
-    } else if (!checklist->request->flags.destinationIPLookedUp()) {
+    } else if (!checklist->request->flags.destinationIpLookedUp) {
         /* No entry in cache, lookup not attempted */
         debugs(28, 3, "aclMatchAcl: Can't yet compare '" << name << "' ACL for '" << checklist->request->GetHost() << "'");
         checklist->changeState (DestinationIPLookup::Instance());
@@ -102,7 +102,7 @@ DestinationIPLookup::LookupDone(const ipcache_addrs *, const DnsLookupDetails &d
 {
     ACLFilledChecklist *checklist = Filled((ACLChecklist*)data);
     assert (checklist->asyncState() == DestinationIPLookup::Instance());
-    checklist->request->flags.destinationIPLookupCompleted();
+    checklist->request->flags.destinationIpLookedUp=true;
     checklist->request->recordLookup(details);
     checklist->asyncInProgress(false);
     checklist->changeState (ACLChecklist::NullState::Instance());
index 46c8247b985c764092d74503b543ad03a5aa7dc9..bddf2a5f82a2ededa9c7b8e23d5477a2339c46eb 100644 (file)
@@ -5,6 +5,7 @@
 #include "comm/forward.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
+#include "SquidConfig.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
 #include "auth/AclProxyAuth.h"
index 6c926d85ed2824e0dbd401be5e9d0ffe64fab58f..d2697883de828ba05eec782fd76581f02a9777cb 100644 (file)
@@ -2,6 +2,7 @@
 #define SQUID_ACLFILLED_CHECKLIST_H
 
 #include "acl/Checklist.h"
+#include "ip/Address.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
 #endif
@@ -9,9 +10,11 @@
 #include "ssl/support.h"
 #endif
 
-class ExternalACLEntry;
+class CachePeer;
 class ConnStateData;
+class ExternalACLEntry;
 class HttpRequest;
+class HttpReply;
 
 /** \ingroup ACLAPI
     ACLChecklist filled with specific data, representing Squid and transaction
@@ -52,7 +55,7 @@ public:
     Ip::Address src_addr;
     Ip::Address dst_addr;
     Ip::Address my_addr;
-    struct peer *dst_peer;
+    CachePeer *dst_peer;
     char *dst_rdns;
 
     HttpRequest *request;
index d65f6e8abda943738abf8b822dca1753bfc38aed..f6fd6ba3cb547b5c3e559dd12d2409c612debc50 100644 (file)
@@ -38,6 +38,8 @@
 
 #include "squid.h"
 #include "acl/Acl.h"
+#include "acl/AclNameList.h"
+#include "acl/AclDenyInfoList.h"
 #include "acl/Checklist.h"
 #include "acl/Strategised.h"
 #include "acl/Gadgets.h"
 
 /* does name lookup, returns page_id */
 err_type
-aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed)
+aclGetDenyInfoPage(AclDenyInfoList ** head, const char *name, int redirect_allowed)
 {
-    acl_deny_info_list *A = NULL;
+    AclDenyInfoList *A = NULL;
 
     debugs(28, 8, HERE << "got called for " << name);
 
     for (A = *head; A; A = A->next) {
-        acl_name_list *L = NULL;
+        AclNameList *L = NULL;
 
         if (!redirect_allowed && strchr(A->err_page_name, ':') ) {
             debugs(28, 8, HERE << "Skip '" << A->err_page_name << "' 30x redirects not allowed as response here.");
@@ -106,14 +108,14 @@ aclIsProxyAuth(const char *name)
  */
 
 void
-aclParseDenyInfoLine(acl_deny_info_list ** head)
+aclParseDenyInfoLine(AclDenyInfoList ** head)
 {
     char *t = NULL;
-    acl_deny_info_list *A = NULL;
-    acl_deny_info_list *B = NULL;
-    acl_deny_info_list **T = NULL;
-    acl_name_list *L = NULL;
-    acl_name_list **Tail = NULL;
+    AclDenyInfoList *A = NULL;
+    AclDenyInfoList *B = NULL;
+    AclDenyInfoList **T = NULL;
+    AclNameList *L = NULL;
+    AclNameList **Tail = NULL;
 
     /* first expect a page name */
 
@@ -123,15 +125,15 @@ aclParseDenyInfoLine(acl_deny_info_list ** head)
         return;
     }
 
-    A = (acl_deny_info_list *)memAllocate(MEM_ACL_DENY_INFO_LIST);
+    A = (AclDenyInfoList *)memAllocate(MEM_ACL_DENY_INFO_LIST);
     A->err_page_id = errorReservePageId(t);
     A->err_page_name = xstrdup(t);
-    A->next = (acl_deny_info_list *) NULL;
+    A->next = (AclDenyInfoList *) NULL;
     /* next expect a list of ACL names */
     Tail = &A->acl_list;
 
     while ((t = strtok(NULL, w_space))) {
-        L = (acl_name_list *)memAllocate(MEM_ACL_NAME_LIST);
+        L = (AclNameList *)memAllocate(MEM_ACL_NAME_LIST);
         xstrncpy(L->name, t, ACL_NAME_SZ);
         *Tail = L;
         Tail = &L->next;
@@ -280,15 +282,15 @@ aclDestroyAccessList(acl_access ** list)
 }
 
 /* maex@space.net (06.09.1996)
- *    destroy an acl_deny_info_list */
+ *    destroy an AclDenyInfoList */
 
 void
-aclDestroyDenyInfoList(acl_deny_info_list ** list)
+aclDestroyDenyInfoList(AclDenyInfoList ** list)
 {
-    acl_deny_info_list *a = NULL;
-    acl_deny_info_list *a_next = NULL;
-    acl_name_list *l = NULL;
-    acl_name_list *l_next = NULL;
+    AclDenyInfoList *a = NULL;
+    AclDenyInfoList *a_next = NULL;
+    AclNameList *l = NULL;
+    AclNameList *l_next = NULL;
 
     debugs(28, 8, "aclDestroyDenyInfoList: invoked");
 
index 38214f546d6f7c1b148ce38b6f4b4502227992b0..49786b5e54bb30084ee5060a916e14a99b1e9e98 100644 (file)
@@ -4,39 +4,39 @@
 #include "err_type.h"
 
 struct dlink_list;
-class StoreEntry;
-class ConfigParser;
 class acl_access;
 class ACL;
+class AclDenyInfoList;
 class ACLList;
-struct acl_deny_info_list;
+class ConfigParser;
+class StoreEntry;
 class wordlist;
 
 /// \ingroup ACLAPI
-extern void aclDestroyAccessList(acl_access **list);
+void aclDestroyAccessList(acl_access **list);
 /// \ingroup ACLAPI
-extern void aclDestroyAcls(ACL **);
+void aclDestroyAcls(ACL **);
 /// \ingroup ACLAPI
-extern void aclDestroyAclList(ACLList **);
+void aclDestroyAclList(ACLList **);
 /// \ingroup ACLAPI
-extern void aclParseAccessLine(ConfigParser &parser, acl_access **);
+void aclParseAccessLine(ConfigParser &parser, acl_access **);
 /// \ingroup ACLAPI
-extern void aclParseAclList(ConfigParser &parser, ACLList **);
+void aclParseAclList(ConfigParser &parser, ACLList **);
 /// \ingroup ACLAPI
-extern int aclIsProxyAuth(const char *name);
+int aclIsProxyAuth(const char *name);
 /// \ingroup ACLAPI
-extern err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed);
+err_type aclGetDenyInfoPage(AclDenyInfoList ** head, const char *name, int redirect_allowed);
 /// \ingroup ACLAPI
-extern void aclParseDenyInfoLine(acl_deny_info_list **);
+void aclParseDenyInfoLine(AclDenyInfoList **);
 /// \ingroup ACLAPI
-extern void aclDestroyDenyInfoList(acl_deny_info_list **);
+void aclDestroyDenyInfoList(AclDenyInfoList **);
 /// \ingroup ACLAPI
-extern wordlist *aclDumpGeneric(const ACL *);
+wordlist *aclDumpGeneric(const ACL *);
 /// \ingroup ACLAPI
-extern void aclCacheMatchFlush(dlink_list * cache);
+void aclCacheMatchFlush(dlink_list * cache);
 /// \ingroup ACLAPI
-extern void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
+void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
 /// \ingroup ACLAPI
-extern void dump_acl_list(StoreEntry * entry, ACLList * head);
+void dump_acl_list(StoreEntry * entry, ACLList * head);
 
 #endif /* SQUID_ACL_GADGETS_H */
index 112230036b8d726bd0b7c9444bce10b26c04ef05..f9a4e54b768b75886240cfa6688c70a01805016f 100644 (file)
@@ -19,7 +19,9 @@ libstate_la_SOURCES = \
        Strategised.h \
        \
        FilledChecklist.cc \
-       FilledChecklist.h
+       FilledChecklist.h \
+       AclAddress.h \
+       AclAddress.cc
 
 ## data-specific ACLs
 libacls_la_SOURCES = \
@@ -105,6 +107,8 @@ libacls_la_SOURCES = \
        UserData.cc \
        UserData.h \
        \
+       AclNameList.h \
+       AclDenyInfoList.h \
        Gadgets.cc \
        Gadgets.h
 
index 817b99578ed5a1b19f6d411ac5fdadfe53cdc45a..49d97187ac0b66a8fecb0c65bd8b9ae0c2bdf8b0 100644 (file)
@@ -38,6 +38,7 @@
 #include "cache_cf.h"
 #include "client_db.h"
 #include "Debug.h"
+#include "SquidConfig.h"
 #include "wordlist.h"
 
 ACL *
index 0d7b584823e86b7d2c43b7501e55753a69c59331..52eed518891484e9c4fac1b62fe7c3816e828daa 100644 (file)
@@ -3,6 +3,7 @@
 #include "acl/RegexData.h"
 #include "acl/StringData.h"
 #include "acl/Checklist.h"
+#include "CachePeer.h"
 
 int
 ACLPeerNameStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
index f950a8b69b7bf1741789a61e24f031a17fcdea7c..12b3607d1a2d1d45144892210329b4238731db97 100644 (file)
 #include "ConfigParser.h"
 #include "Debug.h"
 #include "Mem.h"
+#include "RegexList.h"
 #include "wordlist.h"
 
 static void
-aclDestroyRegexList(relist * data)
+aclDestroyRegexList(RegexList * data)
 {
-    relist *next = NULL;
+    RegexList *next = NULL;
 
     for (; data; data = next) {
         next = data->next;
@@ -69,13 +70,13 @@ ACLRegexData::match(char const *word)
 
     debugs(28, 3, "aclRegexData::match: checking '" << word << "'");
 
-    relist *first, *prev;
+    RegexList *first, *prev;
 
     first = data;
 
     prev = NULL;
 
-    relist *current = first;
+    RegexList *current = first;
 
     while (current) {
         debugs(28, 3, "aclRegexData::match: looking for '" << current->pattern << "'");
@@ -104,7 +105,7 @@ wordlist *
 ACLRegexData::dump()
 {
     wordlist *W = NULL;
-    relist *temp = data;
+    RegexList *temp = data;
     int flags = REG_EXTENDED | REG_NOSUB;
 
     while (temp != NULL) {
@@ -152,11 +153,11 @@ removeUnnecessaryWildcards(char * t)
     return t;
 }
 
-static relist **
-compileRE(relist **Tail, char * RE, int flags)
+static RegexList **
+compileRE(RegexList **Tail, char * RE, int flags)
 {
     int errcode;
-    relist *q;
+    RegexList *q;
     regex_t comp;
 
     if (RE == NULL  ||  *RE == '\0')
@@ -171,7 +172,7 @@ compileRE(relist **Tail, char * RE, int flags)
     }
     debugs(28, 2, "compileRE: compiled '" << RE << "' with flags " << flags );
 
-    q = (relist *) memAllocate(MEM_RELIST);
+    q = (RegexList *) memAllocate(MEM_RELIST);
     q->pattern = xstrdup(RE);
     q->regex = comp;
     q->flags = flags;
@@ -186,11 +187,11 @@ compileRE(relist **Tail, char * RE, int flags)
  * called only once per ACL.
  */
 static int
-compileOptimisedREs(relist **curlist, wordlist * wl)
+compileOptimisedREs(RegexList **curlist, wordlist * wl)
 {
-    relist **Tail;
-    relist *newlist;
-    relist **newlistp;
+    RegexList **Tail;
+    RegexList *newlist;
+    RegexList **newlistp;
     int numREs = 0;
     int flags = REG_EXTENDED | REG_NOSUB;
     int largeREindex = 0;
@@ -288,10 +289,10 @@ compileOptimisedREs(relist **curlist, wordlist * wl)
 }
 
 static void
-compileUnoptimisedREs(relist **curlist, wordlist * wl)
+compileUnoptimisedREs(RegexList **curlist, wordlist * wl)
 {
-    relist **Tail;
-    relist **newTail;
+    RegexList **Tail;
+    RegexList **newTail;
     int flags = REG_EXTENDED | REG_NOSUB;
 
     for (Tail = curlist; *Tail != NULL; Tail = &((*Tail)->next))
@@ -314,7 +315,7 @@ compileUnoptimisedREs(relist **curlist, wordlist * wl)
 }
 
 static void
-aclParseRegexList(relist **curlist)
+aclParseRegexList(RegexList **curlist)
 {
     char *t;
     wordlist *wl = NULL;
index 4011e69e2ff29845afc4b35b0d074e5629d6d91f..87ca21f52c2aece4b1fc561e93dc5079f6a15ea2 100644 (file)
@@ -35,8 +35,7 @@
 #include "acl/Data.h"
 #include "MemPool.h"
 
-/** \todo CLEANUP: break out relist, we don't need the rest. */
-#include "structs.h"
+class RegexList;
 
 class ACLRegexData : public ACLData<char const *>
 {
@@ -52,7 +51,7 @@ public:
     virtual ACLData<char const *> *clone() const;
 
 private:
-    relist *data;
+    RegexList *data;
 };
 
 MEMPROXY_CLASS_INLINE(ACLRegexData);
index 66218b25cca3ea7fdeb167305a3662504781757c..3578514c47d6355d9a71f1bdf01124987ace9400 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "squid.h"
 #include "acl/Strategised.h"
+#include "HttpHeader.h"
 
 /*
  *  moved template instantiation into ACLStrategized.cc
index 0470b005d62133573ecefedc1d6caf7ad671afec..77e5351d58f7d6986b9330e0771433ffb6cadf92 100644 (file)
@@ -12,7 +12,6 @@
 #include "globals.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
-#include "structs.h"
 
 /** \cond AUTODOCS-IGNORE */
 cbdata_type Adaptation::AccessCheck::CBDATA_AccessCheck = CBDATA_UNKNOWN;
index 03b9804bd191d21461d1c3e8708c81204ecce083..28cd2832b71d77d9cac6758cc725c990b2fc7256 100644 (file)
@@ -1,10 +1,9 @@
 #include "squid.h"
-#include "structs.h"
-#include "ConfigParser.h"
 #include "acl/Gadgets.h"
 #include "adaptation/AccessRule.h"
 #include "adaptation/Service.h"
 #include "adaptation/ServiceGroups.h"
+#include "ConfigParser.h"
 #include "Debug.h"
 
 int Adaptation::AccessRule::LastId = 0;
index d7619ff2bf35a3680e08b9f623988e5776436596..09ad60f53fc603d0beb41d57eb3098141eb27705 100644 (file)
@@ -35,9 +35,9 @@ private:
 };
 
 typedef Vector<Adaptation::AccessRule*> AccessRules;
-extern AccessRules &AllRules();
-extern AccessRule *FindRule(const AccessRule::Id &id);
-extern AccessRule *FindRuleByGroupId(const String &groupId);
+AccessRules &AllRules();
+AccessRule *FindRule(const AccessRule::Id &id);
+AccessRule *FindRuleByGroupId(const String &groupId);
 
 } // namespace Adaptation
 
index 4d346f7c0951ba8f5831e57fd195747157cc9b55..0d3b86940f82c895c4e973cca81536bafe3e6536 100644 (file)
@@ -42,7 +42,6 @@
 #include "HttpReply.h"
 #include "HttpRequest.h"
 #include "Store.h"
-#include "structs.h"
 
 bool Adaptation::Config::Enabled = false;
 char *Adaptation::Config::masterx_shared_name = NULL;
index d2af81a88d06a27cc678638b22faa6d141689275..903b1aef24796e7f738df993cb2d496f5a59d9b2 100644 (file)
@@ -39,8 +39,8 @@ namespace Adaptation
 namespace Icap
 {
 
-extern void InitModule();
-extern void CleanModule();
+void InitModule();
+void CleanModule();
 
 } // namespace Icap
 } // namespace Adaptation
index 0e83dd19ad191f590d791e54b85d692a7c38efcb..7fd6798e52636a6b18ae9777c32a72d9906abd76 100644 (file)
@@ -38,6 +38,7 @@
 #include "adaptation/icap/ServiceRep.h"
 #include "HttpRequest.h"
 #include "HttpReply.h"
+#include "SquidConfig.h"
 #include "wordlist.h"
 
 Adaptation::Icap::Config Adaptation::Icap::TheConfig;
index 40535721ae48f4829f0142e9b340993d687029f0..30110d435b547f8bb3144bdfbb4bcbd446ce3198 100644 (file)
@@ -17,6 +17,7 @@
 #include "globals.h"
 #include "HttpReply.h"
 #include "ip/tools.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, ServiceRep);
index 8d09e827991c4d775633b654841fb896cf1f6da4..94d3d4e97f0fdc70558eb4bfdaaa575d78afb3ea 100644 (file)
@@ -24,6 +24,7 @@
 #include "ipcache.h"
 #include "Mem.h"
 #include "pconn.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 //CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, Xaction);
index f9b743cf7690b1baefbf5051b83e73caffb97970..80470480d3d29191b329f0f24ce5a6be464ba29c 100644 (file)
@@ -1,15 +1,17 @@
 #include "squid.h"
 #include "icap_log.h"
 #include "AccessLogEntry.h"
+#include "log/CustomLog.h"
 #include "log/File.h"
 #include "log/Formats.h"
+#include "SquidConfig.h"
 
 int IcapLogfileStatus = LOG_DISABLE;
 
 void
 icapLogOpen()
 {
-    customlog *log;
+    CustomLog *log;
 
     for (log = Config.Log.icaplogs; log; log = log->next) {
         if (log->type == Log::Format::CLF_NONE)
@@ -24,7 +26,7 @@ icapLogOpen()
 void
 icapLogClose()
 {
-    customlog *log;
+    CustomLog *log;
 
     for (log = Config.Log.icaplogs; log; log = log->next) {
         if (log->logfile) {
@@ -37,7 +39,7 @@ icapLogClose()
 void
 icapLogRotate()
 {
-    for (customlog* log = Config.Log.icaplogs; log; log = log->next) {
+    for (CustomLog* log = Config.Log.icaplogs; log; log = log->next) {
         if (log->logfile) {
             logfileRotate(log->logfile);
         }
index fd70ba3f6699e64bb7bac3758cce400058d98fa0..6ab23c354bda391bb256c13fe3ed4c6ea9971da7 100644 (file)
@@ -34,7 +34,7 @@ AuthenticateAcl(ACLChecklist *ch)
     } else if (request->flags.accelerated) {
         /* WWW authorization on accelerated requests */
         headertype = HDR_AUTHORIZATION;
-    } else if (request->flags.intercepted || request->flags.spoof_client_ip) {
+    } else if (request->flags.intercepted || request->flags.spoofClientIp) {
         debugs(28, DBG_IMPORTANT, "NOTICE: Authentication not applicable on intercepted requests.");
         return ACCESS_DENIED;
     } else {
index 0345619e1c904b1a963dfe26d68c05bfb6787047..5f15203fc698cc4c6518fb79ef05686caa9156e4 100644 (file)
@@ -11,7 +11,7 @@
 
 class ACLChecklist;
 /// \ingroup AuthAPI
-extern allow_t AuthenticateAcl(ACLChecklist *ch);
+allow_t AuthenticateAcl(ACLChecklist *ch);
 
 #endif /* USE_AUTH */
 #endif /* SQUID_AUTH_ACL_H */
index 8362c99a49f3cff117904dc40fd90ef00d628646..92a9e6ebe1d41edfa44c6660bf6331c6ebfc2079 100644 (file)
@@ -82,7 +82,7 @@ class StoreEntry;
 typedef void AUTHSSTATS(StoreEntry *);
 
 /// \ingroup AuthAPI
-extern void authenticateInit(Auth::ConfigVector *);
+void authenticateInit(Auth::ConfigVector *);
 
 /** \ingroup AuthAPI
  * Remove all idle authentication state. Intended for use by reconfigure.
@@ -94,19 +94,19 @@ extern void authenticateInit(Auth::ConfigVector *);
  * authentication unless something causes the global config to be rebuilt.
  * Such as a configure load action adding config and re-running authenticateInit().
  */
-extern void authenticateReset(void);
+void authenticateReset(void);
 
-extern void authenticateRotate(void);
+void authenticateRotate(void);
 
 /// \ingroup AuthAPI
-extern void authenticateFreeProxyAuthUserACLResults(void *data);
+void authenticateFreeProxyAuthUserACLResults(void *data);
 /// \ingroup AuthAPI
-extern int authenticateActiveSchemeCount(void);
+int authenticateActiveSchemeCount(void);
 /// \ingroup AuthAPI
-extern int authenticateSchemeCount(void);
+int authenticateSchemeCount(void);
 
 /// \ingroup AuthAPI
-extern void authenticateOnCloseConnection(ConnStateData * conn);
+void authenticateOnCloseConnection(ConnStateData * conn);
 
 #endif /* USE_AUTH */
 #endif /* SQUID_AUTH_GADGETS_H */
index 46c5eade501e8d6510dc56ca2b1be2c4a948f1a1..43266f2c318f7bad98497fe8bd7da4e8d90e8a7b 100644 (file)
@@ -40,6 +40,7 @@
 #include "acl/Gadgets.h"
 #include "event.h"
 #include "globals.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 
index 300d251c36f992180a6a15d9e45afebbc50ad614..787bc29f820ac2adc6acb02de665a714e3f31314 100644 (file)
@@ -227,20 +227,20 @@ private:
 /* AuthUserRequest */
 
 /// \ingroup AuthAPI
-extern void authenticateFixHeader(HttpReply *, Auth::UserRequest::Pointer, HttpRequest *, int, int);
+void authenticateFixHeader(HttpReply *, Auth::UserRequest::Pointer, HttpRequest *, int, int);
 /// \ingroup AuthAPI
-extern void authenticateAddTrailer(HttpReply *, Auth::UserRequest::Pointer, HttpRequest *, int);
+void authenticateAddTrailer(HttpReply *, Auth::UserRequest::Pointer, HttpRequest *, int);
 
 /// \ingroup AuthAPI
-extern void authenticateAuthUserRequestRemoveIp(Auth::UserRequest::Pointer, Ip::Address const &);
+void authenticateAuthUserRequestRemoveIp(Auth::UserRequest::Pointer, Ip::Address const &);
 /// \ingroup AuthAPI
-extern void authenticateAuthUserRequestClearIp(Auth::UserRequest::Pointer);
+void authenticateAuthUserRequestClearIp(Auth::UserRequest::Pointer);
 /// \ingroup AuthAPI
-extern int authenticateAuthUserRequestIPCount(Auth::UserRequest::Pointer);
+int authenticateAuthUserRequestIPCount(Auth::UserRequest::Pointer);
 
 /// \ingroup AuthAPI
 /// See Auth::UserRequest::authenticated()
-extern int authenticateUserAuthenticated(Auth::UserRequest::Pointer);
+int authenticateUserAuthenticated(Auth::UserRequest::Pointer);
 
 #endif /* USE_AUTH */
 #endif /* SQUID_AUTHUSERREQUEST_H */
index 59c9afb948859624645e3597f621ed53d47a426f..0b598f6923c1460d7148c793a8a9b970793c4e7a 100644 (file)
@@ -2,8 +2,8 @@
 #include "auth/basic/auth_basic.h"
 #include "auth/basic/User.h"
 #include "Debug.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
-#include "structs.h"
 
 Auth::Basic::User::User(Auth::Config *aConfig) :
         Auth::User(aConfig),
index 9166e5e32eeddfc02533fe4c2a0253ca650c2207..03c2edf4ff8f83f63a2cadaaf735076a1b8f218e 100644 (file)
@@ -3,8 +3,8 @@
 #include "auth/digest/User.h"
 #include "Debug.h"
 #include "dlink.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
-#include "structs.h"
 
 Auth::Digest::User::User(Auth::Config *aConfig) :
         Auth::User(aConfig),
index 125848b9ae27b60794254ab71f47331753a0d89f..608fbcd5d59c6e683a33cb8ae76626d5e2652e83 100644 (file)
@@ -91,6 +91,7 @@ static const HttpHeaderFieldAttrs DigestAttrs[DIGEST_ENUM_END] = {
     {"response", (http_hdr_type)DIGEST_RESPONSE},
 };
 
+class HttpHeaderFieldInfo;
 static HttpHeaderFieldInfo *DigestFieldsInfo = NULL;
 
 /*
index 0b9c2054aa6aee3821776dde196be42fa3dc5574..fc24aba0e8800b083fe10d55bdd07c21e11d06a3 100644 (file)
@@ -50,12 +50,12 @@ struct _digest_nonce_h : public hash_link {
     } flags;
 };
 
-extern void authDigestNonceUnlink(digest_nonce_h * nonce);
-extern int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
-extern const char *authenticateDigestNonceNonceb64(const digest_nonce_h * nonce);
-extern int authDigestNonceLastRequest(digest_nonce_h * nonce);
-extern void authenticateDigestNonceShutdown(void);
-extern void authDigestNoncePurge(digest_nonce_h * nonce);
+void authDigestNonceUnlink(digest_nonce_h * nonce);
+int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
+const char *authenticateDigestNonceNonceb64(const digest_nonce_h * nonce);
+int authDigestNonceLastRequest(digest_nonce_h * nonce);
+void authenticateDigestNonceShutdown(void);
+void authDigestNoncePurge(digest_nonce_h * nonce);
 
 namespace Auth
 {
index ac4e71cc593c9d575e1d6824740f108c952d1a6a..c93e70375aecae70ac02076af27fc37619d80b8b 100644 (file)
@@ -286,8 +286,8 @@ Auth::Negotiate::UserRequest::HandleReply(void *data, void *lastserver, char *re
             ++arg;
         }
         safe_free(lm_request->server_blob);
-        lm_request->request->flags.must_keepalive = 1;
-        if (lm_request->request->flags.proxy_keepalive) {
+        lm_request->request->flags.mustKeepalive = 1;
+        if (lm_request->request->flags.proxyKeepalive) {
             lm_request->server_blob = xstrdup(blob);
             auth_user_request->user()->credentials(Auth::Handshake);
             auth_user_request->denyMessage("Authentication in progress");
index 556f9c072ca6e32059bef958e9a62a6130ed2d2d..c40bb0818d71c15c0e375a9587d649cc794ea3d5 100644 (file)
@@ -218,7 +218,7 @@ Auth::Negotiate::Config::fixHeader(Auth::UserRequest::Pointer auth_user_request,
         return;
 
     /* Need keep-alive */
-    if (!request->flags.proxy_keepalive && request->flags.must_keepalive)
+    if (!request->flags.proxyKeepalive && request->flags.mustKeepalive)
         return;
 
     /* New request, no user details */
@@ -229,7 +229,7 @@ Auth::Negotiate::Config::fixHeader(Auth::UserRequest::Pointer auth_user_request,
         if (!keep_alive) {
             /* drop the connection */
             rep->header.delByName("keep-alive");
-            request->flags.proxy_keepalive = 0;
+            request->flags.proxyKeepalive = 0;
         }
     } else {
         Auth::Negotiate::UserRequest *negotiate_request = dynamic_cast<Auth::Negotiate::UserRequest *>(auth_user_request.getRaw());
@@ -241,7 +241,7 @@ Auth::Negotiate::Config::fixHeader(Auth::UserRequest::Pointer auth_user_request,
             /* here it makes sense to drop the connection, as auth is
              * tied to it, even if MAYBE the client could handle it - Kinkie */
             rep->header.delByName("keep-alive");
-            request->flags.proxy_keepalive = 0;
+            request->flags.proxyKeepalive = 0;
             /* fall through */
 
         case Auth::Ok:
index bd2b4ffe13c93317a37f624b5ff747ebac9e79c7..3648d51feb52c150feab6fd4a05820c90b7fecdc 100644 (file)
@@ -269,8 +269,8 @@ Auth::Ntlm::UserRequest::HandleReply(void *data, void *lastserver, char *reply)
     if (strncasecmp(reply, "TT ", 3) == 0) {
         /* we have been given a blob to send to the client */
         safe_free(lm_request->server_blob);
-        lm_request->request->flags.must_keepalive = 1;
-        if (lm_request->request->flags.proxy_keepalive) {
+        lm_request->request->flags.mustKeepalive = 1;
+        if (lm_request->request->flags.proxyKeepalive) {
             lm_request->server_blob = xstrdup(blob);
             auth_user_request->user()->credentials(Auth::Handshake);
             auth_user_request->denyMessage("Authentication in progress");
index 8282cc3c3d4d82aac5d159aa390a382bb60f911d..a25f726abf9b276ef834a046112d8cc9d9de9e4c 100644 (file)
@@ -205,7 +205,7 @@ Auth::Ntlm::Config::fixHeader(Auth::UserRequest::Pointer auth_user_request, Http
         return;
 
     /* Need keep-alive */
-    if (!request->flags.proxy_keepalive && request->flags.must_keepalive)
+    if (!request->flags.proxyKeepalive && request->flags.mustKeepalive)
         return;
 
     /* New request, no user details */
@@ -215,7 +215,7 @@ Auth::Ntlm::Config::fixHeader(Auth::UserRequest::Pointer auth_user_request, Http
 
         if (!keep_alive) {
             /* drop the connection */
-            request->flags.proxy_keepalive = 0;
+            request->flags.proxyKeepalive = 0;
         }
     } else {
         Auth::Ntlm::UserRequest *ntlm_request = dynamic_cast<Auth::Ntlm::UserRequest *>(auth_user_request.getRaw());
@@ -226,7 +226,7 @@ Auth::Ntlm::Config::fixHeader(Auth::UserRequest::Pointer auth_user_request, Http
         case Auth::Failed:
             /* here it makes sense to drop the connection, as auth is
              * tied to it, even if MAYBE the client could handle it - Kinkie */
-            request->flags.proxy_keepalive = 0;
+            request->flags.proxyKeepalive = 0;
             /* fall through */
 
         case Auth::Ok:
index eae5c72abfad04981b5c83e149dee00b701e31c9..4a76d76cad75eae5884982d65551962758cf261b 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include "squid.h"
+#include "AsyncCall.h"
 #include "base/AsyncCall.h"
 #include "base/AsyncCallQueue.h"
 #include "cbdata.h"
index 409940804419716ae5583d380eded619d8eb657c..9621e2e463b643f75c8faf0c02f6d0a43a995185 100644 (file)
@@ -5,10 +5,9 @@
 #ifndef SQUID_ASYNCCALL_H
 #define SQUID_ASYNCCALL_H
 
-//#include "cbdata.h"
 #include "base/InstanceId.h"
 #include "event.h"
-//#include "TextException.h"
+#include "RefCount.h"
 
 /**
  \defgroup AsynCallsAPI Async-Calls API
@@ -157,7 +156,7 @@ asyncCall(int aDebugSection, int aDebugLevel, const char *aName,
 }
 
 /** Call scheduling helper. Use ScheduleCallHere if you can. */
-extern bool ScheduleCall(const char *fileName, int fileLine, AsyncCall::Pointer &call);
+bool ScheduleCall(const char *fileName, int fileLine, AsyncCall::Pointer &call);
 
 /** Call scheduling helper. */
 #define ScheduleCallHere(call) ScheduleCall(__FILE__, __LINE__, (call))
index 20a71c43db0d78ca9b3f022e547f1dea321aa6ca..bd7daf7965542cf2e8aeddf6a74bacd9940f834a 100644 (file)
@@ -71,7 +71,7 @@ class FileNameHashCacheUser
                                          (FileNameHashCached(__FILE__)<<14) | (__LINE__ & 0x3FFF))
 #endif
 
-extern void Throw(const char *message, const char *fileName, int lineNo, unsigned int id);
+void Throw(const char *message, const char *fileName, int lineNo, unsigned int id);
 
 // Must(condition) is like assert(condition) but throws an exception instead
 #if !defined(Must)
index 1d4aa6bad381260204a3eec8f0d29746f8484e84..3c4ee2c9d435a5ff2ec5ac4997ad89522bbb48dd 100644 (file)
 
 #include "squid.h"
 #include "acl/Acl.h"
+#include "acl/AclAddress.h"
+#include "acl/AclDenyInfoList.h"
+#include "acl/AclNameList.h"
 #include "acl/Gadgets.h"
 #include "acl/MethodData.h"
 #include "anyp/PortCfg.h"
 #include "AuthReg.h"
 #include "base/RunnersRegistry.h"
+#include "mgr/ActionPasswordList.h"
+#include "CachePeer.h"
+#include "CachePeerDomainList.h"
 #include "cache_cf.h"
 #include "ConfigParser.h"
 #include "CpuAffinityMap.h"
 #include "ip/tools.h"
 #include "ipc/Kids.h"
 #include "log/Config.h"
+#include "log/CustomLog.h"
 #include "Mem.h"
 #include "MemBuf.h"
 #include "mgr/Registration.h"
+#include "NeighborTypeDomainList.h"
 #include "Parsing.h"
 #include "PeerDigest.h"
+#include "RefreshPattern.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidString.h"
+#include "ssl/ProxyCerts.h"
 #include "Store.h"
 #include "StoreFileSystem.h"
 #include "structs.h"
@@ -148,7 +159,7 @@ static void free_ecap_service_type(Adaptation::Ecap::Config *);
 
 static peer_t parseNeighborType(const char *s);
 
-CBDATA_TYPE(peer);
+CBDATA_TYPE(CachePeer);
 
 static const char *const T_MILLISECOND_STR = "millisecond";
 static const char *const T_SECOND_STR = "second";
@@ -168,14 +179,14 @@ static const char *const B_GBYTES_STR = "GB";
 
 static const char *const list_sep = ", \t\n\r";
 
-static void parse_access_log(customlog ** customlog_definitions);
-static int check_null_access_log(customlog *customlog_definitions);
-static void dump_access_log(StoreEntry * entry, const char *name, customlog * definitions);
-static void free_access_log(customlog ** definitions);
+static void parse_access_log(CustomLog ** customlog_definitions);
+static int check_null_access_log(CustomLog *customlog_definitions);
+static void dump_access_log(StoreEntry * entry, const char *name, CustomLog * definitions);
+static void free_access_log(CustomLog ** definitions);
 
 static void update_maxobjsize(void);
 static void configDoConfigure(void);
-static void parse_refreshpattern(refresh_t **);
+static void parse_refreshpattern(RefreshPattern **);
 static uint64_t parseTimeUnits(const char *unit,  bool allowMsec);
 static void parseTimeLine(time_msec_t * tptr, const char *units, bool allowMsec);
 static void parse_u_short(unsigned short * var);
@@ -208,9 +219,9 @@ static void parse_http_header_replace(HeaderManglers **manglers);
 static void dump_HeaderWithAclList(StoreEntry * entry, const char *name, HeaderWithAclList *headers);
 static void parse_HeaderWithAclList(HeaderWithAclList **header);
 static void free_HeaderWithAclList(HeaderWithAclList **header);
-static void parse_denyinfo(acl_deny_info_list ** var);
-static void dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_list * var);
-static void free_denyinfo(acl_deny_info_list ** var);
+static void parse_denyinfo(AclDenyInfoList ** var);
+static void dump_denyinfo(StoreEntry * entry, const char *name, AclDenyInfoList * var);
+static void free_denyinfo(AclDenyInfoList ** var);
 
 #if USE_WCCPv2
 static void parse_IpAddress_list(Ip::Address_list **);
@@ -759,7 +770,7 @@ configDoConfigure(void)
 #if USE_HTTP_VIOLATIONS
 
     {
-        const refresh_t *R;
+        const RefreshPattern *R;
 
         for (R = Config.Refresh; R; R = R->next) {
             if (!R->flags.override_expire)
@@ -918,7 +929,7 @@ configDoConfigure(void)
 
     Config.ssl_client.sslContext = sslCreateClientContext(Config.ssl_client.cert, Config.ssl_client.key, Config.ssl_client.version, Config.ssl_client.cipher, Config.ssl_client.options, Config.ssl_client.flags, Config.ssl_client.cafile, Config.ssl_client.capath, Config.ssl_client.crlfile);
 
-    for (peer *p = Config.peers; p != NULL; p = p->next) {
+    for (CachePeer *p = Config.peers; p != NULL; p = p->next) {
         if (p->use_ssl) {
             debugs(3, DBG_IMPORTANT, "Initializing cache_peer " << p->name << " SSL context");
             p->sslContext = sslCreateClientContext(p->sslcert, p->sslkey, p->sslversion, p->sslcipher, p->ssloptions, p->sslflags, p->sslcafile, p->sslcapath, p->sslcrlfile);
@@ -1360,13 +1371,13 @@ free_address(Ip::Address *addr)
     addr->SetEmpty();
 }
 
-CBDATA_TYPE(acl_address);
+CBDATA_TYPE(AclAddress);
 
 static void
-dump_acl_address(StoreEntry * entry, const char *name, acl_address * head)
+dump_acl_address(StoreEntry * entry, const char *name, AclAddress * head)
 {
     char buf[MAX_IPSTRLEN];
-    acl_address *l;
+    AclAddress *l;
 
     for (l = head; l; l = l->next) {
         if (!l->addr.IsAnyAddr())
@@ -1383,17 +1394,17 @@ dump_acl_address(StoreEntry * entry, const char *name, acl_address * head)
 static void
 freed_acl_address(void *data)
 {
-    acl_address *l = static_cast<acl_address *>(data);
+    AclAddress *l = static_cast<AclAddress *>(data);
     aclDestroyAclList(&l->aclList);
 }
 
 static void
-parse_acl_address(acl_address ** head)
+parse_acl_address(AclAddress ** head)
 {
-    acl_address *l;
-    acl_address **tail = head; /* sane name below */
-    CBDATA_INIT_TYPE_FREECB(acl_address, freed_acl_address);
-    l = cbdataAlloc(acl_address);
+    AclAddress *l;
+    AclAddress **tail = head;  /* sane name below */
+    CBDATA_INIT_TYPE_FREECB(AclAddress, freed_acl_address);
+    l = cbdataAlloc(AclAddress);
     parse_address(&l->addr);
     aclParseAclList(LegacyParser, &l->aclList);
 
@@ -1404,10 +1415,10 @@ parse_acl_address(acl_address ** head)
 }
 
 static void
-free_acl_address(acl_address ** head)
+free_acl_address(AclAddress ** head)
 {
     while (*head) {
-        acl_address *l = *head;
+        AclAddress *l = *head;
         *head = l->next;
         cbdataFree(l);
     }
@@ -1727,7 +1738,7 @@ parse_http_header_access(HeaderManglers **pm)
     if (!*pm)
         *pm = new HeaderManglers;
     HeaderManglers *manglers = *pm;
-    header_mangler *mangler = manglers->track(t);
+    headerMangler *mangler = manglers->track(t);
     assert(mangler);
     parse_acl_access(&mangler->access_list);
 }
@@ -1965,10 +1976,10 @@ peer_type_str(const peer_t type)
 }
 
 static void
-dump_peer(StoreEntry * entry, const char *name, peer * p)
+dump_peer(StoreEntry * entry, const char *name, CachePeer * p)
 {
-    domain_ping *d;
-    domain_type *t;
+    CachePeerDomainList *d;
+    NeighborTypeDomainList *t;
     LOCAL_ARRAY(char, xname, 128);
 
     while (p != NULL) {
@@ -2065,12 +2076,12 @@ GetUdpService(void)
 }
 
 static void
-parse_peer(peer ** head)
+parse_peer(CachePeer ** head)
 {
     char *token = NULL;
-    peer *p;
-    CBDATA_INIT_TYPE_FREECB(peer, peerDestroy);
-    p = cbdataAlloc(peer);
+    CachePeer *p;
+    CBDATA_INIT_TYPE_FREECB(CachePeer, peerDestroy);
+    p = cbdataAlloc(CachePeer);
     p->http_port = CACHE_HTTP_PORT;
     p->icp.port = CACHE_ICP_PORT;
     p->weight = 1;
@@ -2344,9 +2355,9 @@ parse_peer(peer ** head)
 }
 
 static void
-free_peer(peer ** P)
+free_peer(CachePeer ** P)
 {
-    peer *p;
+    CachePeer *p;
 
     while ((p = *P) != NULL) {
         *P = p->next;
@@ -2362,7 +2373,7 @@ free_peer(peer ** P)
 }
 
 static void
-dump_cachemgrpasswd(StoreEntry * entry, const char *name, cachemgr_passwd * list)
+dump_cachemgrpasswd(StoreEntry * entry, const char *name, Mgr::ActionPasswordList * list)
 {
     wordlist *w;
 
@@ -2382,15 +2393,15 @@ dump_cachemgrpasswd(StoreEntry * entry, const char *name, cachemgr_passwd * list
 }
 
 static void
-parse_cachemgrpasswd(cachemgr_passwd ** head)
+parse_cachemgrpasswd(Mgr::ActionPasswordList ** head)
 {
     char *passwd = NULL;
     wordlist *actions = NULL;
-    cachemgr_passwd *p;
-    cachemgr_passwd **P;
+    Mgr::ActionPasswordList *p;
+    Mgr::ActionPasswordList **P;
     parse_string(&passwd);
     parse_wordlist(&actions);
-    p = static_cast<cachemgr_passwd *>(xcalloc(1, sizeof(cachemgr_passwd)));
+    p = new Mgr::ActionPasswordList;
     p->passwd = passwd;
     p->actions = actions;
 
@@ -2399,7 +2410,7 @@ parse_cachemgrpasswd(cachemgr_passwd ** head)
          * See if any of the actions from this line already have a
          * password from previous lines.  The password checking
          * routines in cache_manager.c take the the password from
-         * the first cachemgr_passwd struct that contains the
+         * the first Mgr::ActionPasswordList that contains the
          * requested action.  Thus, we should warn users who might
          * think they can have two passwords for the same action.
          */
@@ -2420,9 +2431,9 @@ parse_cachemgrpasswd(cachemgr_passwd ** head)
 }
 
 static void
-free_cachemgrpasswd(cachemgr_passwd ** head)
+free_cachemgrpasswd(Mgr::ActionPasswordList ** head)
 {
-    cachemgr_passwd *p;
+    Mgr::ActionPasswordList *p;
 
     while ((p = *head) != NULL) {
         *head = p->next;
@@ -2433,9 +2444,9 @@ free_cachemgrpasswd(cachemgr_passwd ** head)
 }
 
 static void
-dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_list * var)
+dump_denyinfo(StoreEntry * entry, const char *name, AclDenyInfoList * var)
 {
-    acl_name_list *a;
+    AclNameList *a;
 
     while (var != NULL) {
         storeAppendPrintf(entry, "%s %s", name, var->err_page_name);
@@ -2450,18 +2461,18 @@ dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_list * var)
 }
 
 static void
-parse_denyinfo(acl_deny_info_list ** var)
+parse_denyinfo(AclDenyInfoList ** var)
 {
     aclParseDenyInfoLine(var);
 }
 
 void
-free_denyinfo(acl_deny_info_list ** list)
+free_denyinfo(AclDenyInfoList ** list)
 {
-    acl_deny_info_list *a = NULL;
-    acl_deny_info_list *a_next = NULL;
-    acl_name_list *l = NULL;
-    acl_name_list *l_next = NULL;
+    AclDenyInfoList *a = NULL;
+    AclDenyInfoList *a_next = NULL;
+    AclNameList *l = NULL;
+    AclNameList *l_next = NULL;
 
     for (a = *list; a; a = a_next) {
         for (l = a->acl_list; l; l = l_next) {
@@ -2482,7 +2493,7 @@ static void
 parse_peer_access(void)
 {
     char *host = NULL;
-    peer *p;
+    CachePeer *p;
 
     if (!(host = strtok(NULL, w_space)))
         self_destruct();
@@ -2505,20 +2516,20 @@ parse_hostdomain(void)
         self_destruct();
 
     while ((domain = strtok(NULL, list_sep))) {
-        domain_ping *l = NULL;
-        domain_ping **L = NULL;
-        peer *p;
+        CachePeerDomainList *l = NULL;
+        CachePeerDomainList **L = NULL;
+        CachePeer *p;
 
         if ((p = peerFindByName(host)) == NULL) {
             debugs(15, DBG_CRITICAL, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'");
             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;
         }
 
@@ -2543,16 +2554,16 @@ parse_hostdomaintype(void)
         self_destruct();
 
     while ((domain = strtok(NULL, list_sep))) {
-        domain_type *l = NULL;
-        domain_type **L = NULL;
-        peer *p;
+        NeighborTypeDomainList *l = NULL;
+        NeighborTypeDomainList **L = NULL;
+        CachePeer *p;
 
         if ((p = peerFindByName(host)) == NULL) {
             debugs(15, DBG_CRITICAL, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'");
             return;
         }
 
-        l = static_cast<domain_type *>(xcalloc(1, sizeof(domain_type)));
+        l = static_cast<NeighborTypeDomainList *>(xcalloc(1, sizeof(NeighborTypeDomainList)));
         l->type = parseNeighborType(type);
         l->domain = xstrdup(domain);
 
@@ -2637,7 +2648,7 @@ parse_tristate(int *var)
 #define free_tristate free_int
 
 static void
-dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * head)
+dump_refreshpattern(StoreEntry * entry, const char *name, RefreshPattern * head)
 {
     while (head != NULL) {
         storeAppendPrintf(entry, "%s%s %s %d %d%% %d",
@@ -2695,7 +2706,7 @@ dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * head)
 }
 
 static void
-parse_refreshpattern(refresh_t ** head)
+parse_refreshpattern(RefreshPattern ** head)
 {
     char *token;
     char *pattern;
@@ -2720,7 +2731,7 @@ parse_refreshpattern(refresh_t ** head)
 #endif
 
     int i;
-    refresh_t *t;
+    RefreshPattern *t;
     regex_t comp;
     int errcode;
     int flags = REG_EXTENDED | REG_NOSUB;
@@ -2825,7 +2836,7 @@ parse_refreshpattern(refresh_t ** head)
 
     pct = pct < 0.0 ? 0.0 : pct;
     max = max < 0 ? 0 : max;
-    t = static_cast<refresh_t *>(xcalloc(1, sizeof(refresh_t)));
+    t = static_cast<RefreshPattern *>(xcalloc(1, sizeof(RefreshPattern)));
     t->pattern = (char *) xstrdup(pattern);
     t->compiled_pattern = comp;
     t->min = min;
@@ -2885,9 +2896,9 @@ parse_refreshpattern(refresh_t ** head)
 }
 
 static void
-free_refreshpattern(refresh_t ** head)
+free_refreshpattern(RefreshPattern ** head)
 {
-    refresh_t *t;
+    RefreshPattern *t;
 
     while ((t = *head) != NULL) {
         *head = t->next;
@@ -3294,18 +3305,6 @@ dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings *
     storeAppendPrintf(entry, "\n");
 }
 
-void
-YesNoNone::configure(bool beSet)
-{
-    option = beSet ? +1 : -1;
-}
-
-YesNoNone::operator void*() const
-{
-    assert(option != 0); // must call configure() first
-    return option > 0 ? (void*)this : NULL;
-}
-
 inline void
 free_YesNoNone(YesNoNone *)
 {
@@ -3981,11 +3980,11 @@ strtokFile(void)
 #include "AccessLogEntry.h"
 
 static void
-parse_access_log(customlog ** logs)
+parse_access_log(CustomLog ** logs)
 {
     const char *filename, *logdef_name;
 
-    customlog *cl = (customlog *)xcalloc(1, sizeof(*cl));
+    CustomLog *cl = (CustomLog *)xcalloc(1, sizeof(*cl));
 
     if ((filename = strtok(NULL, w_space)) == NULL) {
         self_destruct();
@@ -4055,15 +4054,15 @@ parse_access_log(customlog ** logs)
 }
 
 static int
-check_null_access_log(customlog *customlog_definitions)
+check_null_access_log(CustomLog *customlog_definitions)
 {
     return customlog_definitions == NULL;
 }
 
 static void
-dump_access_log(StoreEntry * entry, const char *name, customlog * logs)
+dump_access_log(StoreEntry * entry, const char *name, CustomLog * logs)
 {
-    customlog *log;
+    CustomLog *log;
 
     for (log = logs; log; log = log->next) {
         storeAppendPrintf(entry, "%s ", name);
@@ -4115,10 +4114,10 @@ dump_access_log(StoreEntry * entry, const char *name, customlog * logs)
 }
 
 static void
-free_access_log(customlog ** definitions)
+free_access_log(CustomLog ** definitions)
 {
     while (*definitions) {
-        customlog *log = *definitions;
+        CustomLog *log = *definitions;
         *definitions = log->next;
 
         log->logFormat = NULL;
index c1e5faec66b5f61f5d004bf2bd2115ce526d4d34..2ee1c955f48b330ee25c85cbdfeb4c66242c853a 100644 (file)
 
 class wordlist;
 
-extern void configFreeMemory(void);
-extern void self_destruct(void);
-extern void add_http_port(char *portspec);
+void configFreeMemory(void);
+void self_destruct(void);
+void add_http_port(char *portspec);
 
 /* extra functions from cache_cf.c useful for lib modules */
-extern void parse_int(int *var);
-extern void parse_onoff(int *var);
-extern void parse_eol(char *volatile *var);
-extern void parse_wordlist(wordlist ** list);
-extern void requirePathnameExists(const char *name, const char *path);
-extern void parse_time_t(time_t * var);
-extern char *strtokFile(void);
+void parse_int(int *var);
+void parse_onoff(int *var);
+void parse_eol(char *volatile *var);
+void parse_wordlist(wordlist ** list);
+void requirePathnameExists(const char *name, const char *path);
+void parse_time_t(time_t * var);
+char *strtokFile(void);
 
 #endif /* SQUID_CACHE_CF_H_ */
index dbb961b7cc7080970ee6e2a0bb81ce9dfef2520e..d5f8b3538ae9ec68b810eb0e933e48d15c201429 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "base/TextException.h"
+#include "mgr/ActionPasswordList.h"
 #include "CacheManager.h"
 #include "comm/Connection.h"
 #include "Debug.h"
@@ -49,6 +50,7 @@
 #include "mgr/QueryParams.h"
 #include "protos.h"
 #include "tools.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "wordlist.h"
@@ -458,12 +460,12 @@ CacheManager::ActionProtection(const Mgr::ActionProfile::Pointer &profile)
 }
 
 /*
- \ingroup CacheManagerInternal
\ingroup CacheManagerInternal
  * gets from the global Config the password the user would need to supply
  * for the action she queried
  */
 char *
-CacheManager::PasswdGet(cachemgr_passwd * a, const char *action)
+CacheManager::PasswdGet(Mgr::ActionPasswordList * a, const char *action)
 {
     wordlist *w;
 
index fa8ef6ba6b296260d4ee1ab6a5708a2f12f28883..37e916c1b59d0f8f49c534da3acab33c0f7f71ec 100644 (file)
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "HttpRequest.h"
 #include "mgr/Registration.h"
 #include "neighbors.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "URL.h"
 #include "URLScheme.h"
 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
 
 static int n_carp_peers = 0;
-static peer **carp_peers = NULL;
+static CachePeer **carp_peers = NULL;
 static OBJH carpCachemgr;
 
 static int
 peerSortWeight(const void *a, const void *b)
 {
-    const peer *const *p1 = (const peer *const *)a;
-    const peer *const *p2 = (const peer *const *)b;
+    const CachePeer *const *p1 = (const CachePeer *const *)a;
+    const CachePeer *const *p2 = (const CachePeer *const *)b;
     return (*p1)->weight - (*p2)->weight;
 }
 
@@ -71,8 +73,8 @@ carpInit(void)
     int K;
     int k;
     double P_last, X_last, Xn;
-    peer *p;
-    peer **P;
+    CachePeer *p;
+    CachePeer **P;
     char *t;
     /* Clean up */
 
@@ -105,7 +107,7 @@ carpInit(void)
     if (n_carp_peers == 0)
         return;
 
-    carp_peers = (peer **)xcalloc(n_carp_peers, sizeof(*carp_peers));
+    carp_peers = (CachePeer **)xcalloc(n_carp_peers, sizeof(*carp_peers));
 
     /* Build a list of the found peers and calculate hashes and load factors */
     for (P = carp_peers, p = Config.peers; p; p = p->next) {
@@ -167,12 +169,12 @@ carpInit(void)
     }
 }
 
-peer *
+CachePeer *
 carpSelectParent(HttpRequest * request)
 {
     int k;
-    peer *p = NULL;
-    peer *tp;
+    CachePeer *p = NULL;
+    CachePeer *tp;
     unsigned int user_hash = 0;
     unsigned int combined_hash;
     double score;
@@ -184,7 +186,7 @@ carpSelectParent(HttpRequest * request)
     /* calculate hash key */
     debugs(39, 2, "carpSelectParent: Calculating hash for " << urlCanonical(request));
 
-    /* select peer */
+    /* select CachePeer */
     for (k = 0; k < n_carp_peers; ++k) {
         String key;
         tp = carp_peers[k];
@@ -250,7 +252,7 @@ carpSelectParent(HttpRequest * request)
 static void
 carpCachemgr(StoreEntry * sentry)
 {
-    peer *p;
+    CachePeer *p;
     int sumfetches = 0;
     storeAppendPrintf(sentry, "%24s %10s %10s %10s %10s\n",
                       "Hostname",
index be7be8fce616fcd3da486dd0a13304c33ca1ba52..c7fe1f07e277e3319b0f6966ecaef3f9dc8d0c6e 100644 (file)
 #ifndef SQUID_CARP_H_
 #define SQUID_CARP_H_
 
-class peer;
+class CachePeer;
 class HttpRequest;
 
-extern void carpInit(void);
-extern peer *carpSelectParent(HttpRequest *);
+void carpInit(void);
+CachePeer *carpSelectParent(HttpRequest *);
 
 #endif /* SQUID_CARP_H_ */
index c1fedba0365719c0fbeb74ca459c54ce474ba82f..a30cfff4bf4f86340bd36ed4a6468ccb279e9a58 100644 (file)
@@ -234,30 +234,30 @@ typedef enum {
 } cbdata_type;
 
 /// \ingroup CBDATAAPI
-extern void cbdataRegisterWithCacheManager(void);
+void cbdataRegisterWithCacheManager(void);
 
 #if USE_CBDATA_DEBUG
-extern void *cbdataInternalAllocDbg(cbdata_type type, const char *, int);
-extern void *cbdataInternalFreeDbg(void *p, const char *, int);
-extern void cbdataInternalLockDbg(const void *p, const char *, int);
-extern void cbdataInternalUnlockDbg(const void *p, const char *, int);
-extern int cbdataInternalReferenceDoneValidDbg(void **p, void **tp, const char *, int);
+void *cbdataInternalAllocDbg(cbdata_type type, const char *, int);
+void *cbdataInternalFreeDbg(void *p, const char *, int);
+void cbdataInternalLockDbg(const void *p, const char *, int);
+void cbdataInternalUnlockDbg(const void *p, const char *, int);
+int cbdataInternalReferenceDoneValidDbg(void **p, void **tp, const char *, int);
 #else
 
 /// \ingroup CBDATAAPI
-extern void *cbdataInternalAlloc(cbdata_type type);
+void *cbdataInternalAlloc(cbdata_type type);
 
 /// \ingroup CBDATAAPI
-extern void *cbdataInternalFree(void *p);
+void *cbdataInternalFree(void *p);
 
 /// \ingroup CBDATAAPI
-extern void cbdataInternalLock(const void *p);
+void cbdataInternalLock(const void *p);
 
 /// \ingroup CBDATAAPI
-extern void cbdataInternalUnlock(const void *p);
+void cbdataInternalUnlock(const void *p);
 
 /// \ingroup CBDATAAPI
-extern int cbdataInternalReferenceDoneValid(void **p, void **tp);
+int cbdataInternalReferenceDoneValid(void **p, void **tp);
 
 #endif /* !CBDATA_DEBUG */
 
@@ -269,10 +269,10 @@ extern int cbdataInternalReferenceDoneValid(void **p, void **tp);
  \retval 0     A reference is stale. The pointer refers to a entry freed by cbdataFree().
  \retval true  The reference is valid and active.
  */
-extern int cbdataReferenceValid(const void *p);
+int cbdataReferenceValid(const void *p);
 
 /// \ingroup CBDATAAPI
-extern cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func);
+cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func);
 
 /* cbdata macros */
 #if USE_CBDATA_DEBUG
index 7ed485c04679392e276daefb82929f6955f19ff5..cce0a12c042fe11b08fcbdb469c35027e9fa0d9b 100644 (file)
@@ -40,6 +40,7 @@
 #include "log/access_log.h"
 #include "Mem.h"
 #include "mgr/Registration.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
index 7b0f03f5d3ca87a553e7cc3eedda3fef1e484c82..4a7765af0cdf20a16fe67cb299b1ec39d3975845 100644 (file)
 #include "anyp/ProtocolType.h"
 #include "enums.h"
 #include "ip/Address.h"
+namespace Ip {
+class Address;
+}
 
 class StoreEntry;
 class ClientInfo;
 
-extern void clientdbInit(void);
-extern void clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t);
-extern int clientdbCutoffDenied(const Ip::Address &);
-extern void clientdbDump(StoreEntry *);
-extern void clientdbFreeMemory(void);
-extern int clientdbEstablished(const Ip::Address &, int);
+void clientdbInit(void);
+void clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t);
+int clientdbCutoffDenied(const Ip::Address &);
+void clientdbDump(StoreEntry *);
+void clientdbFreeMemory(void);
+int clientdbEstablished(const Ip::Address &, int);
 
 #if USE_DELAY_POOLS
-extern void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark);
-extern ClientInfo * clientdbGetInfo(const Ip::Address &addr);
+void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark);
+ClientInfo * clientdbGetInfo(const Ip::Address &addr);
 #endif
 
 #if SQUID_SNMP
-extern Ip::Address *client_entry(Ip::Address *current);
+Ip::Address *client_entry(Ip::Address *current);
 #endif
 
 #endif /* SQUID_CLIENT_DB_H_ */
index 84db45fc675b2f94c1479438727d692c15d567a3..624d78c5dfbe23c97550d66b0f3ca9d415215fc1 100644 (file)
@@ -83,6 +83,7 @@
 #include "anyp/PortCfg.h"
 #include "base/Subscription.h"
 #include "base/TextException.h"
+#include "CachePeer.h"
 #include "ChunkedCodingParser.h"
 #include "client_db.h"
 #include "client_side_reply.h"
 #include "mime_header.h"
 #include "profiler/Profiler.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "StatHist.h"
 #include "ClientInfo.h"
 #endif
 #if USE_SSL
+#include "ssl/ProxyCerts.h"
 #include "ssl/context_storage.h"
 #include "ssl/helper.h"
 #include "ssl/ServerBump.h"
@@ -831,7 +834,7 @@ ConnStateData::~ConnStateData()
 }
 
 /**
- * clientSetKeepaliveFlag() sets request->flags.proxy_keepalive.
+ * clientSetKeepaliveFlag() sets request->flags.proxyKeepalive.
  * This is the client-side persistent connection flag.  We need
  * to set this relatively early in the request processing
  * to handle hacks for broken servers and clients.
@@ -847,7 +850,7 @@ clientSetKeepaliveFlag(ClientHttpRequest * http)
            RequestMethodStr(request->method));
 
     // TODO: move to HttpRequest::hdrCacheInit, just like HttpReply.
-    request->flags.proxy_keepalive = request->persistent() ? 1 : 0;
+    request->flags.proxyKeepalive = request->persistent() ? 1 : 0;
 }
 
 static int
@@ -983,7 +986,7 @@ ClientSocketContext::sendBody(HttpReply * rep, StoreIOBuffer bodyData)
 {
     assert(rep == NULL);
 
-    if (!multipartRangeRequest() && !http->request->flags.chunked_reply) {
+    if (!multipartRangeRequest() && !http->request->flags.chunkedReply) {
         size_t length = lengthToSend(bodyData.range());
         noteSentBodyBytes (length);
         AsyncCall::Pointer call = commCbCall(33, 5, "clientWriteBodyComplete",
@@ -1267,7 +1270,7 @@ ClientSocketContext::buildRangeHeader(HttpReply * rep)
     else if (rep->content_length != http->memObject()->getReply()->content_length)
         range_err = "INCONSISTENT length";     /* a bug? */
 
-    /* hits only - upstream peer determines correct behaviour on misses, and client_side_reply determines
+    /* hits only - upstream CachePeer determines correct behaviour on misses, and client_side_reply determines
      * hits candidates
      */
     else if (logTypeIsATcpHit(http->logType) && http->request->header.has(HDR_IF_RANGE) && !clientIfRangeMatch(http, rep))
@@ -1392,7 +1395,7 @@ ClientSocketContext::sendStartOfMessage(HttpReply * rep, StoreIOBuffer bodyData)
     if (bodyData.data && bodyData.length) {
         if (multipartRangeRequest())
             packRange(bodyData, mb);
-        else if (http->request->flags.chunked_reply) {
+        else if (http->request->flags.chunkedReply) {
             packChunk(bodyData, *mb);
         } else {
             size_t length = lengthToSend(bodyData.range());
@@ -1447,8 +1450,8 @@ clientSocketRecipient(clientStreamNode * node, ClientHttpRequest * http,
 
     // After sending Transfer-Encoding: chunked (at least), always send
     // the last-chunk if there was no error, ignoring responseFinishedOrFailed.
-    const bool mustSendLastChunk = http->request->flags.chunked_reply &&
-                                   !http->request->flags.stream_error && !context->startOfOutput();
+    const bool mustSendLastChunk = http->request->flags.chunkedReply &&
+                                   !http->request->flags.streamError && !context->startOfOutput();
     if (responseFinishedOrFailed(rep, receivedData) && !mustSendLastChunk) {
         context->writeComplete(context->clientConnection, NULL, 0, COMM_OK);
         PROF_stop(clientSocketRecipient);
@@ -1736,7 +1739,7 @@ ClientSocketContext::socketState()
                 debugs(33, 5, HERE << "Range request at end of returnable " <<
                        "range sequence on " << clientConnection);
 
-                if (http->request->flags.proxy_keepalive)
+                if (http->request->flags.proxyKeepalive)
                     return STREAM_COMPLETE;
                 else
                     return STREAM_UNPLANNED_COMPLETE;
@@ -1753,7 +1756,7 @@ ClientSocketContext::socketState()
             // did we get at least what we expected, based on range specs?
 
             if (bytesSent == bytesExpected) { // got everything
-                if (http->request->flags.proxy_keepalive)
+                if (http->request->flags.proxyKeepalive)
                     return STREAM_COMPLETE;
                 else
                     return STREAM_UNPLANNED_COMPLETE;
@@ -1763,7 +1766,7 @@ ClientSocketContext::socketState()
             // expected why would persistency matter? Should not this
             // always be an error?
             if (bytesSent > bytesExpected) { // got extra
-                if (http->request->flags.proxy_keepalive)
+                if (http->request->flags.proxyKeepalive)
                     return STREAM_COMPLETE;
                 else
                     return STREAM_UNPLANNED_COMPLETE;
@@ -2469,7 +2472,7 @@ ConnStateData::quitAfterError(HttpRequest *request)
     // at the client-side, but many such errors do require closure and the
     // client-side code is bad at handling errors so we play it safe.
     if (request)
-        request->flags.proxy_keepalive = 0;
+        request->flags.proxyKeepalive = 0;
     flags.readMore = false;
     debugs(33,4, HERE << "Will close after error: " << clientConnection);
 }
@@ -2650,11 +2653,11 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
     request->clientConnectionManager = conn;
 
     request->flags.accelerated = http->flags.accel;
-    request->flags.sslBumped = conn->switchedToHttps();
+    request->flags.sslBumped=conn->switchedToHttps();
     request->flags.canRePin = request->flags.sslBumped && conn->pinning.pinned;
-    request->flags.ignore_cc = conn->port->ignore_cc;
+    request->flags.ignoreCc = conn->port->ignore_cc;
     // TODO: decouple http->flags.accel from request->flags.sslBumped
-    request->flags.no_direct = (request->flags.accelerated && !request->flags.sslBumped) ?
+    request->flags.noDirect = (request->flags.accelerated && !request->flags.sslBumped) ?
                                !conn->port->allow_direct : 0;
 #if USE_AUTH
     if (request->flags.sslBumped) {
@@ -2669,7 +2672,7 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
      */
     if (http->clientConnection != NULL) {
         request->flags.intercepted = ((http->clientConnection->flags & COMM_INTERCEPTION) != 0);
-        request->flags.spoof_client_ip = ((http->clientConnection->flags & COMM_TRANSPARENT) != 0 ) ;
+        request->flags.spoofClientIp = ((http->clientConnection->flags & COMM_TRANSPARENT) != 0 ) ;
     }
 
     if (internalCheck(request->urlpath.termedBuf())) {
@@ -2821,7 +2824,7 @@ finish:
      * be freed and the above connNoteUseOfBuffer() would hit an
      * assertion, not to mention that we were accessing freed memory.
      */
-    if (request && request->flags.resetTCP() && Comm::IsConnOpen(conn->clientConnection)) {
+    if (request && request->flags.resetTcp && Comm::IsConnOpen(conn->clientConnection)) {
         debugs(33, 3, HERE << "Sending TCP RST on " << conn->clientConnection);
         conn->flags.readMore = false;
         comm_reset_close(conn->clientConnection);
@@ -3146,7 +3149,7 @@ ConnStateData::abortChunkedRequestBody(const err_type error)
         repContext->setReplyToError(error, scode,
                                     repContext->http->request->method,
                                     repContext->http->uri,
-                                    peer,
+                                    CachePeer,
                                     repContext->http->request,
                                     in.buf, NULL);
         context->pullData();
@@ -3215,7 +3218,7 @@ ConnStateData::requestTimeout(const CommTimeoutCbParams &io)
         clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
         assert (repContext);
         repContext->setReplyToError(ERR_LIFETIME_EXP,
-                                    HTTP_REQUEST_TIMEOUT, METHOD_NONE, "N/A", &peer.sin_addr,
+                                    HTTP_REQUEST_TIMEOUT, METHOD_NONE, "N/A", &CachePeer.sin_addr,
                                     NULL, NULL, NULL);
         /* No requests can be outstanded */
         assert(chr == NULL);
@@ -3578,7 +3581,7 @@ httpsEstablish(ConnStateData *connState,  SSL_CTX *sslContext, Ssl::BumpMode bum
         fakeRequest->indirect_client_addr = connState->clientConnection->remote;
 #endif
         fakeRequest->my_addr = connState->clientConnection->local;
-        fakeRequest->flags.spoof_client_ip = ((connState->clientConnection->flags & COMM_TRANSPARENT) != 0 ) ;
+        fakeRequest->flags.spoofClientIp = ((connState->clientConnection->flags & COMM_TRANSPARENT) != 0 ) ;
         fakeRequest->flags.intercepted = ((connState->clientConnection->flags & COMM_INTERCEPTION) != 0);
         debugs(33, 4, HERE << details << " try to generate a Dynamic SSL CTX");
         connState->switchToHttps(fakeRequest, bumpMode);
@@ -3889,7 +3892,7 @@ ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
 
     // commSetConnTimeout() was called for this request before we switched.
 
-    // Disable the client read handler until peer selection is complete
+    // Disable the client read handler until CachePeer selection is complete
     Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);
     Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, clientNegotiateSSL, this, 0);
     switchedToHttps_ = true;
@@ -4416,7 +4419,7 @@ ConnStateData::clientPinnedConnectionClosed(const CommCloseCbParams &io)
 }
 
 void
-ConnStateData::pinConnection(const Comm::ConnectionPointer &pinServer, HttpRequest *request, struct peer *aPeer, bool auth)
+ConnStateData::pinConnection(const Comm::ConnectionPointer &pinServer, HttpRequest *request, CachePeer *aPeer, bool auth)
 {
     char desc[FD_DESC_SZ];
 
@@ -4462,7 +4465,7 @@ ConnStateData::pinConnection(const Comm::ConnectionPointer &pinServer, HttpReque
 }
 
 const Comm::ConnectionPointer
-ConnStateData::validatePinnedConnection(HttpRequest *request, const struct peer *aPeer)
+ConnStateData::validatePinnedConnection(HttpRequest *request, const CachePeer *aPeer)
 {
     debugs(33, 7, HERE << pinning.serverConnection);
 
index 62a916cffafc581055fc95a41d260624086242be..279aaf6ea41f66a868dfc2d8dda1ea99971a77b9 100644 (file)
@@ -53,6 +53,9 @@ class ConnStateData;
 class ClientHttpRequest;
 class clientStreamNode;
 class ChunkedCodingParser;
+namespace AnyP {
+    class PortCfg;
+} // namespace Anyp
 
 /**
  * Badly named.
@@ -259,7 +262,7 @@ public:
         int port;               /* port of pinned connection */
         bool pinned;             /* this connection was pinned */
         bool auth;               /* pinned for www authentication */
-        struct peer *peer;             /* peer the connection goes via */
+        CachePeer *peer;             /* CachePeer the connection goes via */
         AsyncCall::Pointer closeHandler; /*The close handler for pinned server side connection*/
     } pinning;
 
@@ -290,23 +293,23 @@ public:
     /**
      * Correlate the current ConnStateData object with the pinning_fd socket descriptor.
      */
-    void pinConnection(const Comm::ConnectionPointer &pinServerConn, HttpRequest *request, struct peer *peer, bool auth);
+    void pinConnection(const Comm::ConnectionPointer &pinServerConn, HttpRequest *request, CachePeer *peer, bool auth);
     /**
-     * Decorrelate the ConnStateData object from its pinned peer
+     * Decorrelate the ConnStateData object from its pinned CachePeer
      */
     void unpinConnection();
     /**
      * Checks if there is pinning info if it is valid. It can close the server side connection
      * if pinned info is not valid.
      \param request   if it is not NULL also checks if the pinning info refers to the request client side HttpRequest
-     \param peer      if it is not NULL also check if the peer is the pinning peer
+     \param CachePeer      if it is not NULL also check if the CachePeer is the pinning CachePeer
      \return          The details of the server side connection (may be closed if failures were present).
      */
-    const Comm::ConnectionPointer validatePinnedConnection(HttpRequest *request, const struct peer *peer);
+    const Comm::ConnectionPointer validatePinnedConnection(HttpRequest *request, const CachePeer *peer);
     /**
-     * returts the pinned peer if exists, NULL otherwise
+     * returts the pinned CachePeer if exists, NULL otherwise
      */
-    struct peer *pinnedPeer() const {return pinning.peer;}
+    CachePeer *pinnedPeer() const {return pinning.peer;}
     bool pinnedAuth() const {return pinning.auth;}
 
     // pining related comm callbacks
@@ -405,19 +408,14 @@ private:
     CBDATA_CLASS2(ConnStateData);
 };
 
-/* convenience class while splitting up body handling */
-/* temporary existence only - on stack use expected */
-
 void setLogUri(ClientHttpRequest * http, char const *uri, bool cleanUrl = false);
 
 const char *findTrailingHTTPVersion(const char *uriAndHTTPVersion, const char *end = NULL);
 
-/* Vary support functions */
-extern int varyEvaluateMatch(StoreEntry * entry, HttpRequest * req);
+int varyEvaluateMatch(StoreEntry * entry, HttpRequest * req);
 
-/* client_side.c - FD related client side routines */
-extern void clientOpenListenSockets(void);
-extern void clientHttpConnectionsClose(void);
-extern void httpRequestFree(void *);
+void clientOpenListenSockets(void);
+void clientHttpConnectionsClose(void);
+void httpRequestFree(void *);
 
 #endif /* SQUID_CLIENTSIDE_H */
index a527dab4778c93ced1b6d790b66fa5d4b9778c01..4080026a75dc0068a7c786c6015e4c2c90f1143f 100644 (file)
@@ -54,6 +54,8 @@
 #include "mime_header.h"
 #include "neighbors.h"
 #include "refresh.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StoreClient.h"
@@ -127,11 +129,11 @@ void clientReplyContext::setReplyToError(const HttpRequestMethod& method, ErrorS
 {
     if (errstate->httpStatus == HTTP_NOT_IMPLEMENTED && http->request)
         /* prevent confusion over whether we default to persistent or not */
-        http->request->flags.proxy_keepalive = 0;
+        http->request->flags.proxyKeepalive = 0;
 
     http->al->http.code = errstate->httpStatus;
 
-    createStoreEntry(method, request_flags());
+    createStoreEntry(method, RequestFlags());
     assert(errstate->callback_data == NULL);
     errorAppendEntry(http->storeEntry(), errstate);
     /* Now the caller reads to get this */
@@ -225,7 +227,7 @@ clientReplyContext::restoreState()
 void
 clientReplyContext::startError(ErrorState * err)
 {
-    createStoreEntry(http->request->method, request_flags());
+    createStoreEntry(http->request->method, RequestFlags());
     triggerInitialStoreRead();
     errorAppendEntry(http->storeEntry(), err);
 }
@@ -388,7 +390,7 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result)
     // origin replied 304
     if (status == HTTP_NOT_MODIFIED) {
         http->logType = LOG_TCP_REFRESH_UNMODIFIED;
-        http->request->flags.stale_if_hit = 0; // old_entry is no longer stale
+        http->request->flags.staleIfHit = 0; // old_entry is no longer stale
 
         // update headers on existing entry
         old_rep->updateOnNotModified(http->storeEntry()->getReply());
@@ -417,7 +419,7 @@ clientReplyContext::handleIMSReply(StoreIOBuffer result)
     }
 
     // origin replied with an error
-    else if (http->request->flags.fail_on_validation_err) {
+    else if (http->request->flags.failOnValidationError) {
         http->logType = LOG_TCP_REFRESH_FAIL_ERR;
         debugs(88, 3, "handleIMSReply: origin replied with error " << status <<
                ", forwarding to client due to fail_on_validation_err");
@@ -540,9 +542,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
     }
 
     if (e->checkNegativeHit()
-#if USE_HTTP_VIOLATIONS
-            && !r->flags.nocache_hack
-#endif
+            && !r->flags.noCacheHack()
        ) {
         http->logType = LOG_TCP_NEGATIVE_HIT;
         sendMoreData(result);
@@ -552,13 +552,13 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
          * We hold a stale copy; it needs to be validated
          */
         /*
-         * The 'need_validation' flag is used to prevent forwarding
+         * The 'needValidation' flag is used to prevent forwarding
          * loops between siblings.  If our copy of the object is stale,
          * then we should probably only use parents for the validation
          * request.  Otherwise two siblings could generate a loop if
          * both have a stale version of the object.
          */
-        r->flags.need_validation = 1;
+        r->flags.needValidation = 1;
 
         if (e->lastmod < 0) {
             /*
@@ -567,7 +567,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
              */
             http->logType = LOG_TCP_MISS;
             processMiss();
-        } else if (r->flags.nocache) {
+        } else if (r->flags.noCache) {
             /*
              * This did not match a refresh pattern that overrides no-cache
              * we should honour the client no-cache header.
@@ -652,10 +652,10 @@ clientReplyContext::processMiss()
     }
 
     /// Deny loops
-    if (r->flags.loopdetect) {
+    if (r->flags.loopDetected) {
         http->al->http.code = HTTP_FORBIDDEN;
         err = clientBuildError(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, NULL, http->getConn()->clientConnection->remote, http->request);
-        createStoreEntry(r->method, request_flags());
+        createStoreEntry(r->method, RequestFlags());
         errorAppendEntry(http->storeEntry(), err);
         triggerInitialStoreRead();
         return;
@@ -993,7 +993,7 @@ clientReplyContext::purgeDoPurgeHead(StoreEntry *newEntry)
     /* FIXME: This doesn't need to go through the store. Simply
      * push down the client chain
      */
-    createStoreEntry(http->request->method, request_flags());
+    createStoreEntry(http->request->method, RequestFlags());
 
     triggerInitialStoreRead();
 
@@ -1008,7 +1008,7 @@ clientReplyContext::traceReply(clientStreamNode * node)
 {
     clientStreamNode *nextNode = (clientStreamNode *)node->node.next->data;
     StoreIOBuffer localTempBuffer;
-    createStoreEntry(http->request->method, request_flags());
+    createStoreEntry(http->request->method, RequestFlags());
     localTempBuffer.offset = nextNode->readBuffer.offset + headers_sz;
     localTempBuffer.length = nextNode->readBuffer.length;
     localTempBuffer.data = nextNode->readBuffer.data;
@@ -1040,7 +1040,7 @@ clientReplyContext::checkTransferDone()
     if (http->flags.done_copying)
         return 1;
 
-    if (http->request->flags.chunked_reply && !flags.complete) {
+    if (http->request->flags.chunkedReply && !flags.complete) {
         // last-chunk was not sent
         return 0;
     }
@@ -1184,7 +1184,7 @@ clientReplyContext::replyStatus()
 
         const int64_t expectedBodySize =
             http->storeEntry()->getReply()->bodySize(http->request->method);
-        if (!http->request->flags.proxy_keepalive && expectedBodySize < 0) {
+        if (!http->request->flags.proxyKeepalive && expectedBodySize < 0) {
             debugs(88, 5, "clientReplyStatus: closing, content_length < 0");
             return STREAM_FAILED;
         }
@@ -1199,7 +1199,7 @@ clientReplyContext::replyStatus()
             return STREAM_UNPLANNED_COMPLETE;
         }
 
-        if (http->request->flags.proxy_keepalive) {
+        if (http->request->flags.proxyKeepalive) {
             debugs(88, 5, "clientReplyStatus: stream complete and can keepalive");
             return STREAM_COMPLETE;
         }
@@ -1374,9 +1374,9 @@ clientReplyContext::buildReplyHeader()
     }
 
     // add Warnings required by RFC 2616 if serving a stale hit
-    if (http->request->flags.stale_if_hit && logTypeIsATcpHit(http->logType)) {
+    if (http->request->flags.staleIfHit && logTypeIsATcpHit(http->logType)) {
         hdr->putWarning(110, "Response is stale");
-        if (http->request->flags.need_validation)
+        if (http->request->flags.needValidation)
             hdr->putWarning(111, "Revalidation failed");
     }
 
@@ -1399,11 +1399,11 @@ clientReplyContext::buildReplyHeader()
                         ||
                         (strncasecmp(value, "Kerberos", 8) == 0 &&
                          (value[8] == '\0' || value[8] == ' '))) {
-                    if (request->flags.connection_auth_disabled) {
+                    if (request->flags.connectionAuthDisabled) {
                         hdr->delAt(pos, connection_auth_blocked);
                         continue;
                     }
-                    request->flags.must_keepalive = 1;
+                    request->flags.mustKeepalive = 1;
                     if (!request->flags.accelerated && !request->flags.intercepted) {
                         httpHeaderPutStrf(hdr, HDR_PROXY_SUPPORT, "Session-Based-Authentication");
                         /*
@@ -1452,45 +1452,41 @@ clientReplyContext::buildReplyHeader()
 
 #endif
 
-    // XXX: chunking a Content-Range response may not violate specs, but our
-    // ClientSocketContext::writeComplete() confuses the end of ClientStream
-    // with the end of to-client writing and may quit before writing last-chunk
-    const bool maySendChunkedReply = !reply->content_range &&
-                                     !request->multipartRangeRequest() &&
+    const bool maySendChunkedReply = !request->multipartRangeRequest() &&
                                      reply->sline.protocol == AnyP::PROTO_HTTP && // response is HTTP
                                      (request->http_ver >= HttpVersion(1, 1));
 
     /* Check whether we should send keep-alive */
-    if (!Config.onoff.error_pconns && reply->sline.status >= 400 && !request->flags.must_keepalive) {
+    if (!Config.onoff.error_pconns && reply->sline.status >= 400 && !request->flags.mustKeepalive) {
         debugs(33, 3, "clientBuildReplyHeader: Error, don't keep-alive");
-        request->flags.proxy_keepalive = 0;
-    } else if (!Config.onoff.client_pconns && !request->flags.must_keepalive) {
+        request->flags.proxyKeepalive = 0;
+    } else if (!Config.onoff.client_pconns && !request->flags.mustKeepalive) {
         debugs(33, 2, "clientBuildReplyHeader: Connection Keep-Alive not requested by admin or client");
-        request->flags.proxy_keepalive = 0;
-    } else if (request->flags.proxy_keepalive && shutting_down) {
+        request->flags.proxyKeepalive = 0;
+    } else if (request->flags.proxyKeepalive && shutting_down) {
         debugs(88, 3, "clientBuildReplyHeader: Shutting down, don't keep-alive.");
-        request->flags.proxy_keepalive = 0;
-    } else if (request->flags.connection_auth && !reply->keep_alive) {
+        request->flags.proxyKeepalive = 0;
+    } else if (request->flags.connectionAuth && !reply->keep_alive) {
         debugs(33, 2, "clientBuildReplyHeader: Connection oriented auth but server side non-persistent");
-        request->flags.proxy_keepalive = 0;
+        request->flags.proxyKeepalive = 0;
     } else if (reply->bodySize(request->method) < 0 && !maySendChunkedReply) {
         debugs(88, 3, "clientBuildReplyHeader: can't keep-alive, unknown body size" );
-        request->flags.proxy_keepalive = 0;
-    } else if (fdUsageHigh()&& !request->flags.must_keepalive) {
+        request->flags.proxyKeepalive = 0;
+    } else if (fdUsageHigh()&& !request->flags.mustKeepalive) {
         debugs(88, 3, "clientBuildReplyHeader: Not many unused FDs, can't keep-alive");
-        request->flags.proxy_keepalive = 0;
+        request->flags.proxyKeepalive = 0;
     } else if (request->flags.sslBumped && !reply->persistent()) {
         // We do not really have to close, but we pretend we are a tunnel.
         debugs(88, 3, "clientBuildReplyHeader: bumped reply forces close");
-        request->flags.proxy_keepalive = 0;
+        request->flags.proxyKeepalive = 0;
     }
 
     // Decide if we send chunked reply
     if (maySendChunkedReply &&
-            request->flags.proxy_keepalive &&
+            request->flags.proxyKeepalive &&
             reply->bodySize(request->method) < 0) {
         debugs(88, 3, "clientBuildReplyHeader: chunked reply");
-        request->flags.chunked_reply = 1;
+        request->flags.chunkedReply = 1;
         hdr->putStr(HDR_TRANSFER_ENCODING, "chunked");
     }
 
@@ -1508,7 +1504,7 @@ clientReplyContext::buildReplyHeader()
         hdr->putStr(HDR_VIA, strVia.termedBuf());
     }
     /* Signal keep-alive or close explicitly */
-    hdr->putStr(HDR_CONNECTION, request->flags.proxy_keepalive ? "keep-alive" : "close");
+    hdr->putStr(HDR_CONNECTION, request->flags.proxyKeepalive ? "keep-alive" : "close");
 
 #if ADD_X_REQUEST_URI
     /*
@@ -1587,7 +1583,7 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry)
     /** \li If the request has no-cache flag set or some no_cache HACK in operation we
       * 'invalidate' the cached IP entries for this request ???
       */
-    if (r->flags.nocache) {
+    if (r->flags.noCache) {
 
 #if USE_DNSHELPER
         ipcacheInvalidate(r->GetHost());
@@ -1595,11 +1591,7 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry)
         ipcacheInvalidateNegative(r->GetHost());
 #endif /* USE_DNSHELPER */
 
-    }
-
-#if USE_HTTP_VIOLATIONS
-
-    else if (r->flags.nocache_hack) {
+    } else if (r->flags.noCacheHack()) {
 
 #if USE_DNSHELPER
         ipcacheInvalidate(r->GetHost());
@@ -1609,11 +1601,8 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry)
 
     }
 
-#endif /* USE_HTTP_VIOLATIONS */
 #if USE_CACHE_DIGESTS
-
     lookup_type = http->storeEntry() ? "HIT" : "MISS";
-
 #endif
 
     if (NULL == http->storeEntry()) {
@@ -1657,7 +1646,7 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry)
         return;
     }
 
-    if (r->flags.nocache) {
+    if (r->flags.noCache) {
         debugs(85, 3, "clientProcessRequest2: no-cache REFRESH MISS");
         http->storeEntry(NULL);
         http->logType = LOG_TCP_CLIENT_REFRESH_MISS;
@@ -1827,7 +1816,7 @@ clientReplyContext::sendStreamError(StoreIOBuffer const &result)
     debugs(88, 5, "clientReplyContext::sendStreamError: A stream error has occured, marking as complete and sending no data.");
     StoreIOBuffer localTempBuffer;
     flags.complete = 1;
-    http->request->flags.stream_error = 1;
+    http->request->flags.streamError = 1;
     localTempBuffer.flags.error = result.flags.error;
     clientStreamCallback((clientStreamNode*)http->client_stream.head->data, http, NULL,
                          localTempBuffer);
@@ -1898,7 +1887,7 @@ clientReplyContext::sendNotModified()
     HttpReply *const temprep = e->getReply()->make304();
     http->logType = LOG_TCP_IMS_HIT;
     removeClientStoreReference(&sc, http);
-    createStoreEntry(http->request->method, request_flags());
+    createStoreEntry(http->request->method, RequestFlags());
     e = http->storeEntry();
     // Copy timestamp from the original entry so the 304
     // reply has a meaningful Age: header.
@@ -2160,7 +2149,7 @@ clientReplyContext::sendMoreData (StoreIOBuffer result)
 /* Using this breaks the client layering just a little!
  */
 void
-clientReplyContext::createStoreEntry(const HttpRequestMethod& m, request_flags reqFlags)
+clientReplyContext::createStoreEntry(const HttpRequestMethod& m, RequestFlags reqFlags)
 {
     assert(http != NULL);
     /*
index a0639940014b22b4a773f1b704ed4e9d53fcc75c..155b814d3ea438fa3ccd5be54fda6cfe7a311665 100644 (file)
 #ifndef SQUID_CLIENTSIDEREPLY_H
 #define SQUID_CLIENTSIDEREPLY_H
 
-#include "RefCount.h"
-#include "HttpHeader.h"
+#include "client_side_request.h"
 #include "clientStream.h"
+#include "HttpHeader.h"
+#include "RefCount.h"
+#include "RequestFlags.h"
 #include "StoreClient.h"
-#include "client_side_request.h"
 
 class ErrorState;
 #include "ip/forward.h"
@@ -82,7 +83,7 @@ public:
 #endif
     /// creates a store entry for the reply and appends err to it
     void setReplyToError(const HttpRequestMethod& method, ErrorState *err);
-    void createStoreEntry(const HttpRequestMethod& m, request_flags flags);
+    void createStoreEntry(const HttpRequestMethod& m, RequestFlags flags);
     void removeStoreReference(store_client ** scp, StoreEntry ** ep);
     void removeClientStoreReference(store_client **scp, ClientHttpRequest *http);
     void startError(ErrorState * err);
index 75c80293b04a1d5e84c24a1c6370f38577079f16..593e4114fa6ccb0d8b9712a32a97f3a8576e6898 100644 (file)
@@ -67,6 +67,7 @@
 #include "MemObject.h"
 #include "Parsing.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StrList.h"
@@ -388,7 +389,7 @@ clientBeginRequest(const HttpRequestMethod& method, char const *url, CSCB * stre
      */
     request->flags.accelerated = http->flags.accel;
 
-    request->flags.internalclient = 1;
+    request->flags.internalClient = 1;
 
     /* this is an internally created
      * request, not subject to acceleration
@@ -533,7 +534,7 @@ clientFollowXForwardedForCheck(allow_t answer, void *data)
         conn->log_addr = request->indirect_client_addr;
     }
     request->x_forwarded_for_iterator.clean();
-    request->flags.done_follow_x_forwarded_for = 1;
+    request->flags.done_follow_x_forwarded_for=true;
 
     if (answer != ACCESS_ALLOWED && answer != ACCESS_DENIED) {
         debugs(28, DBG_CRITICAL, "ERROR: Processing X-Forwarded-For. Stopping at IP address: " << request->indirect_client_addr );
@@ -584,7 +585,7 @@ ClientRequestContext::hostHeaderVerifyFailed(const char *A, const char *B)
         debugs(85, 3, "SECURITY ALERT: Host header forgery detected on " << http->getConn()->clientConnection <<
                " (" << A << " does not match " << B << ") on URL: " << urlCanonical(http->request));
 
-        // NP: it is tempting to use 'flags.nocache' but that is all about READing cache data.
+        // NP: it is tempting to use 'flags.noCache' but that is all about READing cache data.
         // The problems here are about WRITE for new cache content, which means flags.cachable
         http->request->flags.cachable = 0; // MUST NOT cache (for now)
         // XXX: when we have updated the cache key to base on raw-IP + URI this cacheable limit can go.
@@ -663,7 +664,7 @@ ClientRequestContext::hostHeaderVerify()
     }
 
     debugs(85, 3, HERE << "validate host=" << host << ", port=" << port << ", portStr=" << (portStr?portStr:"NULL"));
-    if (http->request->flags.intercepted || http->request->flags.spoof_client_ip) {
+    if (http->request->flags.intercepted || http->request->flags.spoofClientIp) {
         // verify the Host: port (if any) matches the apparent destination
         if (portStr && port != http->getConn()->clientConnection->local.GetPort()) {
             debugs(85, 3, HERE << "FAIL on validate port " << http->getConn()->clientConnection->local.GetPort() <<
@@ -709,7 +710,7 @@ void
 ClientRequestContext::clientAccessCheck()
 {
 #if FOLLOW_X_FORWARDED_FOR
-    if (!http->request->flags.done_follow_x_forwarded_for &&
+    if (!http->request->flags.doneFollowXff() &&
             Config.accessList.followXFF &&
             http->request->header.has(HDR_X_FORWARDED_FOR)) {
 
@@ -725,7 +726,7 @@ ClientRequestContext::clientAccessCheck()
         acl_checklist->nonBlockingCheck(clientFollowXForwardedForCheck, this);
         return;
     }
-#endif /* FOLLOW_X_FORWARDED_FOR */
+#endif
 
     if (Config.accessList.http) {
         acl_checklist = clientAclChecklistCreate(Config.accessList.http, http);
@@ -923,7 +924,7 @@ clientHierarchical(ClientHttpRequest * http)
     const wordlist *p = NULL;
 
     // intercepted requests MUST NOT (yet) be sent to peers unless verified
-    if (!request->flags.hostVerified && (request->flags.intercepted || request->flags.spoof_client_ip))
+    if (!request->flags.hostVerified && (request->flags.intercepted || request->flags.spoofClientIp))
         return 0;
 
     /*
@@ -952,7 +953,7 @@ clientHierarchical(ClientHttpRequest * http)
         if (strstr(url, p->key))
             return 0;
 
-    if (request->flags.loopdetect)
+    if (request->flags.loopDetected)
         return 0;
 
     if (request->protocol == AnyP::PROTO_HTTP)
@@ -980,14 +981,14 @@ clientCheckPinning(ClientHttpRequest * http)
     if (!http_conn)
         return;
 
-    request->flags.connection_auth_disabled = http_conn->port->connection_auth_disabled;
-    if (!request->flags.connection_auth_disabled) {
+    request->flags.connectionAuthDisabled = http_conn->port->connection_auth_disabled;
+    if (!request->flags.connectionAuthDisabled) {
         if (Comm::IsConnOpen(http_conn->pinning.serverConnection)) {
             if (http_conn->pinning.auth) {
-                request->flags.connection_auth = 1;
+                request->flags.connectionAuth = 1;
                 request->flags.auth = 1;
             } else {
-                request->flags.connection_proxy_auth = 1;
+                request->flags.connectionProxyAuth = 1;
             }
             // These should already be linked correctly.
             assert(request->clientConnectionManager == http_conn);
@@ -996,10 +997,10 @@ clientCheckPinning(ClientHttpRequest * http)
 
     /* check if connection auth is used, and flag as candidate for pinning
      * in such case.
-     * Note: we may need to set flags.connection_auth even if the connection
+     * Note: we may need to set flags.connectionAuth even if the connection
      * is already pinned if it was pinned earlier due to proxy auth
      */
-    if (!request->flags.connection_auth) {
+    if (!request->flags.connectionAuth) {
         if (req_hdr->has(HDR_AUTHORIZATION) || req_hdr->has(HDR_PROXY_AUTHORIZATION)) {
             HttpHeaderPos pos = HttpHeaderInitPos;
             HttpHeaderEntry *e;
@@ -1013,10 +1014,10 @@ clientCheckPinning(ClientHttpRequest * http)
                             ||
                             strncasecmp(value, "Kerberos ", 9) == 0) {
                         if (e->id == HDR_AUTHORIZATION) {
-                            request->flags.connection_auth = 1;
+                            request->flags.connectionAuth = 1;
                             may_pin = 1;
                         } else {
-                            request->flags.connection_proxy_auth = 1;
+                            request->flags.connectionProxyAuth = 1;
                             may_pin = 1;
                         }
                     }
@@ -1044,7 +1045,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
     if (request->ims > 0)
         request->flags.ims = 1;
 
-    if (!request->flags.ignore_cc) {
+    if (!request->flags.ignoreCc) {
         if (req_hdr->has(HDR_PRAGMA)) {
             String s = req_hdr->getList(HDR_PRAGMA);
 
@@ -1089,13 +1090,13 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
 #if USE_HTTP_VIOLATIONS
 
         if (Config.onoff.reload_into_ims)
-            request->flags.nocache_hack = 1;
+            request->flags.nocacheHack = 1;
         else if (refresh_nocache_hack)
-            request->flags.nocache_hack = 1;
+            request->flags.nocacheHack = 1;
         else
 #endif
 
-            request->flags.nocache = 1;
+            request->flags.noCache = 1;
     }
 
     /* ignore range header in non-GETs or non-HEADs */
@@ -1105,7 +1106,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
             request->range = req_hdr->getRange();
 
         if (request->range) {
-            request->flags.range = 1;
+            request->flags.isRanged=true;
             clientStreamNode *node = (clientStreamNode *)http->client_stream.tail->data;
             /* XXX: This is suboptimal. We should give the stream the range set,
              * and thereby let the top of the stream set the offset when the
@@ -1149,7 +1150,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
         if (strListIsSubstr(&s, ThisCache2, ',')) {
             debugObj(33, 1, "WARNING: Forwarding loop detected for:\n",
                      request, (ObjPackMethod) & httpRequestPack);
-            request->flags.loopdetect = 1;
+            request->flags.loopDetected = 1;
         }
 
 #if USE_FORW_VIA_DB
@@ -1176,7 +1177,7 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
         request->flags.hierarchical = 1;
 
     debugs(85, 5, "clientInterpretRequestHeaders: REQ_NOCACHE = " <<
-           (request->flags.nocache ? "SET" : "NOT SET"));
+           (request->flags.noCache ? "SET" : "NOT SET"));
     debugs(85, 5, "clientInterpretRequestHeaders: REQ_CACHABLE = " <<
            (request->flags.cachable ? "SET" : "NOT SET"));
     debugs(85, 5, "clientInterpretRequestHeaders: REQ_HIERARCHICAL = " <<
index a296e7a1350a680b7d43be7ff484aa1f9bcf2a08..3dbe32969991c6c273840baa467beefa1cf84c9b 100644 (file)
 #include "AccessLogEntry.h"
 #include "dlink.h"
 #include "base/AsyncJob.h"
+#include "HttpHeaderRange.h"
 
 #if USE_ADAPTATION
 #include "adaptation/forward.h"
 #include "adaptation/Initiator.h"
-
 class HttpMsg;
 #endif
 
-/* client_side_request.c - client side request related routines (pure logic) */
-extern int clientBeginRequest(const HttpRequestMethod&, char const *, CSCB *, CSD *, ClientStreamData, HttpHeader const *, char *, size_t);
-
+class acl_access;
+class ACLFilledChecklist;
+class ClientRequestContext;
+class ConnStateData;
 class MemObject;
 
-class ConnStateData;
+/* client_side_request.c - client side request related routines (pure logic) */
+int clientBeginRequest(const HttpRequestMethod&, char const *, CSCB *, CSD *, ClientStreamData, HttpHeader const *, char *, size_t);
 
-class ClientRequestContext;
 
 class ClientHttpRequest
 #if USE_ADAPTATION
@@ -199,16 +200,15 @@ private:
 };
 
 /* client http based routines */
-extern char *clientConstructTraceEcho(ClientHttpRequest *);
+char *clientConstructTraceEcho(ClientHttpRequest *);
 
-class ACLFilledChecklist;
-extern ACLFilledChecklist *clientAclChecklistCreate(const acl_access * acl,ClientHttpRequest * http);
-extern int clientHttpRequestStatus(int fd, ClientHttpRequest const *http);
-extern void clientAccessCheck(ClientHttpRequest *);
+ACLFilledChecklist *clientAclChecklistCreate(const acl_access * acl,ClientHttpRequest * http);
+int clientHttpRequestStatus(int fd, ClientHttpRequest const *http);
+void clientAccessCheck(ClientHttpRequest *);
 
 /* ones that should be elsewhere */
-extern void redirectStart(ClientHttpRequest *, RH *, void *);
-extern void tunnelStart(ClientHttpRequest *, int64_t *, int *);
+void redirectStart(ClientHttpRequest *, RH *, void *);
+void tunnelStart(ClientHttpRequest *, int64_t *, int *);
 
 #if _USE_INLINE_
 #include "Store.h"
index 28ff50b4d42efd4965c0f10516aa31e2a1861293..c5a1ed7010a79310886f05d559f1e63a4644d938 100644 (file)
@@ -59,6 +59,7 @@
 #include "MemBuf.h"
 #include "pconn.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "StoreIOBuffer.h"
@@ -113,7 +114,6 @@ static void commSetTcpNoDelay(int);
 #endif
 static void commSetTcpRcvbuf(int, int);
 
-static MemAllocator *conn_close_pool = NULL;
 fd_debug_t *fdd_table = NULL;
 
 bool
@@ -1461,8 +1461,6 @@ comm_init(void)
      * Since Squid_MaxFD can be as high as several thousand, don't waste them */
     RESERVED_FD = min(100, Squid_MaxFD / 4);
 
-    conn_close_pool = memPoolCreate("close_handler", sizeof(close_handler));
-
     TheHalfClosed = new DescriptorSet;
 
     /* setup the select loop module */
index 32dab7a09fabba2d1aec4673ff157135a141448f..ad723d8d20d6951fc06e2247757d22d03f573d80 100644 (file)
@@ -6,32 +6,34 @@
 #include "CommCalls.h"
 #include "comm_err_t.h"
 #include "comm/IoCallback.h"
-#include "ip/Address.h"
 #include "StoreIOBuffer.h"
 
-/* comm.c */
-extern bool comm_iocallbackpending(void); /* inline candidate */
+namespace Ip {
+class Address;
+}
 
-SQUIDCEXTERN int commSetNonBlocking(int fd);
-SQUIDCEXTERN int commUnsetNonBlocking(int fd);
-SQUIDCEXTERN void commSetCloseOnExec(int fd);
-SQUIDCEXTERN void commSetTcpKeepalive(int fd, int idle, int interval, int timeout);
-extern void _comm_close(int fd, char const *file, int line);
+bool comm_iocallbackpending(void); /* inline candidate */
+
+int commSetNonBlocking(int fd);
+int commUnsetNonBlocking(int fd);
+void commSetCloseOnExec(int fd);
+void commSetTcpKeepalive(int fd, int idle, int interval, int timeout);
+void _comm_close(int fd, char const *file, int line);
 #define comm_close(x) (_comm_close((x), __FILE__, __LINE__))
-SQUIDCEXTERN void old_comm_reset_close(int fd);
-SQUIDCEXTERN void comm_reset_close(const Comm::ConnectionPointer &conn);
+void old_comm_reset_close(int fd);
+void comm_reset_close(const Comm::ConnectionPointer &conn);
 #if LINGERING_CLOSE
-SQUIDCEXTERN void comm_lingering_close(int fd);
+void comm_lingering_close(int fd);
 #endif
 
-SQUIDCEXTERN int comm_connect_addr(int sock, const Ip::Address &addr);
-SQUIDCEXTERN void comm_init(void);
-SQUIDCEXTERN void comm_exit(void);
+int comm_connect_addr(int sock, const Ip::Address &addr);
+void comm_init(void);
+void comm_exit(void);
 
-SQUIDCEXTERN int comm_open(int, int, Ip::Address &, int, const char *note);
-SQUIDCEXTERN int comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags);
+int comm_open(int, int, Ip::Address &, int, const char *note);
+int comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags);
 /// update Comm state after getting a comm_open() FD from another process
-SQUIDCEXTERN void comm_import_opened(const Comm::ConnectionPointer &, const char *note, struct addrinfo *AI);
+void comm_import_opened(const Comm::ConnectionPointer &, const char *note, struct addrinfo *AI);
 
 /**
  * Open a port specially bound for listening or sending through a specific port.
@@ -48,53 +50,53 @@ SQUIDCEXTERN void comm_import_opened(const Comm::ConnectionPointer &, const char
  * (in debugs or cachemgr) will occur in Native IPv4 format.
  * A reconfigure is needed to reset the stored IP in most cases and attempt a port re-open.
  */
-extern int comm_open_listener(int sock_type, int proto, Ip::Address &addr, int flags, const char *note);
-extern void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note);
+int comm_open_listener(int sock_type, int proto, Ip::Address &addr, int flags, const char *note);
+void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note);
 
-SQUIDCEXTERN int comm_openex(int, int, Ip::Address &, int, tos_t tos, nfmark_t nfmark, const char *);
-SQUIDCEXTERN unsigned short comm_local_port(int fd);
+int comm_openex(int, int, Ip::Address &, int, tos_t tos, nfmark_t nfmark, const char *);
+unsigned short comm_local_port(int fd);
 
-SQUIDCEXTERN int comm_udp_sendto(int sock, const Ip::Address &to, const void *buf, int buflen);
-SQUIDCEXTERN void commCallCloseHandlers(int fd);
+int comm_udp_sendto(int sock, const Ip::Address &to, const void *buf, int buflen);
+void commCallCloseHandlers(int fd);
 
 /// clear a timeout handler by FD number
-extern void commUnsetFdTimeout(int fd);
+void commUnsetFdTimeout(int fd);
 
 /**
  * Set or clear the timeout for some action on an active connection.
  * API to replace commSetTimeout() when a Comm::ConnectionPointer is available.
  */
-extern int commSetConnTimeout(const Comm::ConnectionPointer &conn, int seconds, AsyncCall::Pointer &callback);
-extern int commUnsetConnTimeout(const Comm::ConnectionPointer &conn);
+int commSetConnTimeout(const Comm::ConnectionPointer &conn, int seconds, AsyncCall::Pointer &callback);
+int commUnsetConnTimeout(const Comm::ConnectionPointer &conn);
 
-SQUIDCEXTERN int ignoreErrno(int);
-SQUIDCEXTERN void commCloseAllSockets(void);
-SQUIDCEXTERN void checkTimeouts(void);
+int ignoreErrno(int);
+void commCloseAllSockets(void);
+void checkTimeouts(void);
 
 //typedef void IOACB(int fd, int nfd, Comm::ConnectionPointer details, comm_err_t flag, int xerrno, void *data);
-extern void comm_add_close_handler(int fd, CLCB *, void *);
-extern void comm_add_close_handler(int fd, AsyncCall::Pointer &);
-extern void comm_remove_close_handler(int fd, CLCB *, void *);
-extern void comm_remove_close_handler(int fd, AsyncCall::Pointer &);
-
-extern int comm_has_pending_read_callback(int fd);
-extern bool comm_monitors_read(int fd);
-//extern void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, IOCB *handler, void *data);
-extern void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback);
-extern void comm_read_cancel(int fd, IOCB *callback, void *data);
-extern void comm_read_cancel(int fd, AsyncCall::Pointer &callback);
-extern int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from);
-extern int comm_udp_recv(int fd, void *buf, size_t len, int flags);
-extern ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags);
-extern bool comm_has_incomplete_write(int);
+void comm_add_close_handler(int fd, CLCB *, void *);
+void comm_add_close_handler(int fd, AsyncCall::Pointer &);
+void comm_remove_close_handler(int fd, CLCB *, void *);
+void comm_remove_close_handler(int fd, AsyncCall::Pointer &);
+
+int comm_has_pending_read_callback(int fd);
+bool comm_monitors_read(int fd);
+//void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, IOCB *handler, void *data);
+void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback);
+void comm_read_cancel(int fd, IOCB *callback, void *data);
+void comm_read_cancel(int fd, AsyncCall::Pointer &callback);
+int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from);
+int comm_udp_recv(int fd, void *buf, size_t len, int flags);
+ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags);
+bool comm_has_incomplete_write(int);
 
 /** The read channel has closed and the caller does not expect more data
  * but needs to detect connection aborts. The current detection method uses
  * 0-length reads: We read until the error occurs or the writer closes
  * the connection. If there is a read error, we close the connection.
  */
-extern void commStartHalfClosedMonitor(int fd);
-extern bool commHasHalfClosedMonitor(int fd);
+void commStartHalfClosedMonitor(int fd);
+bool commHasHalfClosedMonitor(int fd);
 // XXX: remove these wrappers which minimize client_side.cc changes in a commit
 inline void commMarkHalfClosed(int fd) { commStartHalfClosedMonitor(fd); }
 inline bool commIsHalfClosed(int fd) { return commHasHalfClosedMonitor(fd); }
index 4c2ea0398fcd665be92f1d627f7323e2dfe00b0c..d0272af30555a114aff2b0e578837024157c71a8 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "comm/ConnOpener.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "globals.h"
 #include "icmp/net_db.h"
 #include "ipcache.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
 
+class CachePeer;
+
 CBDATA_NAMESPACED_CLASS_INIT(Comm, ConnOpener);
 
 Comm::ConnOpener::ConnOpener(Comm::ConnectionPointer &c, AsyncCall::Pointer &handler, time_t ctimeout) :
@@ -203,11 +207,11 @@ Comm::ConnOpener::connected()
 
     /*
      * stats.conn_open is used to account for the number of
-     * connections that we have open to the peer, so we can limit
+     * connections that we have open to the CachePeer, so we can limit
      * based on the max-conn option.  We need to increment here,
      * even if the connection may fail.
      */
-    if (peer *peer=(conn_->getPeer()))
+    if (CachePeer *peer=(conn_->getPeer()))
         ++peer->stats.conn_open;
 
     lookupLocalAddress();
index c0e8a34739d9f4640762d2e27b712bea6daec0de..e73923285f30ded2e457b05604f4d436f1036efa 100644 (file)
@@ -1,10 +1,12 @@
 #include "squid.h"
+#include "CachePeer.h"
 #include "cbdata.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "fde.h"
 #include "SquidTime.h"
 
+class CachePeer;
 bool
 Comm::IsConnOpen(const Comm::ConnectionPointer &conn)
 {
@@ -18,7 +20,7 @@ Comm::Connection::Connection() :
         fd(-1),
         tos(0),
         flags(COMM_NONBLOCKING),
-        _peer(NULL)
+        peer_(NULL)
 {
     *rfc931 = 0; // quick init the head. the rest does not matter.
 }
@@ -32,7 +34,7 @@ Comm::Connection::~Connection()
         close();
     }
 
-    cbdataReferenceDone(_peer);
+    cbdataReferenceDone(peer_);
 }
 
 Comm::ConnectionPointer
@@ -49,8 +51,8 @@ Comm::Connection::copyDetails() const
     // ensure FD is not open in the new copy.
     c->fd = -1;
 
-    // ensure we have a cbdata reference to _peer not a straight ptr copy.
-    c->_peer = cbdataReference(getPeer());
+    // ensure we have a cbdata reference to peer_ not a straight ptr copy.
+    c->peer_ = cbdataReference(getPeer());
 
     return c;
 }
@@ -61,29 +63,29 @@ Comm::Connection::close()
     if (isOpen()) {
         comm_close(fd);
         fd = -1;
-        if (peer *p=getPeer())
+        if (CachePeer *p=getPeer())
             -- p->stats.conn_open;
     }
 }
 
-peer *
+CachePeer *
 Comm::Connection::getPeer() const
 {
-    if (cbdataReferenceValid(_peer))
-        return _peer;
+    if (cbdataReferenceValid(peer_))
+        return peer_;
 
     return NULL;
 }
 
 void
-Comm::Connection::setPeer(peer *p)
+Comm::Connection::setPeer(CachePeer *p)
 {
     /* set to self. nothing to do. */
     if (getPeer() == p)
         return;
 
-    cbdataReferenceDone(_peer);
+    cbdataReferenceDone(peer_);
     if (p) {
-        _peer = cbdataReference(p);
+        peer_ = cbdataReference(p);
     }
 }
index ec5b9fc67a85769aec3cfc4da1603b61b5f8d667..1f15a004630a4074d2abebca1c0a407269413ce8 100644 (file)
@@ -56,7 +56,7 @@
 #include <ostream>
 #endif
 
-struct peer;
+class CachePeer;
 
 namespace Comm
 {
@@ -108,16 +108,16 @@ public:
     /** determine whether this object describes an active connection or not. */
     bool isOpen() const { return (fd >= 0); }
 
-    /** retrieve the peer pointer for use.
+    /** retrieve the CachePeer pointer for use.
      * The caller is responsible for all CBDATA operations regarding the
      * used of the pointer returned.
      */
-    peer * getPeer() const;
+    CachePeer * getPeer() const;
 
-    /** alter the stored peer pointer.
-     * Perform appropriate CBDATA operations for locking the peer pointer
+    /** alter the stored CachePeer pointer.
+     * Perform appropriate CBDATA operations for locking the CachePeer pointer
      */
-    void setPeer(peer * p);
+    void setPeer(CachePeer * p);
 
 private:
     /** These objects may not be exactly duplicated. Use copyDetails() instead. */
@@ -156,12 +156,8 @@ public:
 #endif
 
 private:
-    // XXX: we need to call this member peer_ but the struct peer_ global type
-    //      behind peer* clashes despite our private Comm:: namespace
-    //      (it being global gets inherited here too).
-
     /** cache_peer data object (if any) */
-    peer *_peer;
+    CachePeer *peer_;
 };
 
 }; // namespace Comm
index 116d3497cd7a3519f43bf58fa859403eb92d3e12..85f021e371de614b14482a6052b478dc200f2c82 100644 (file)
@@ -63,8 +63,8 @@ public:
 /// Callbacks which might be scheduled in future are stored in fd_table.
 extern CbEntry *iocb_table;
 
-extern void CallbackTableInit();
-extern void CallbackTableDestruct();
+void CallbackTableInit();
+void CallbackTableDestruct();
 
 #define COMMIO_FD_READCB(fd)    (&Comm::iocb_table[(fd)].readcb)
 #define COMMIO_FD_WRITECB(fd)   (&Comm::iocb_table[(fd)].writecb)
index 7c1159feee30dad5c62e9bae34f56534faa6efc7..d587da9392337ab54ea11e7be86fc851d541bb75 100644 (file)
@@ -16,20 +16,20 @@ namespace Comm
 {
 
 /// Initialize the module on Squid startup
-extern void SelectLoopInit(void);
+void SelectLoopInit(void);
 
 /// Mark an FD to be watched for its IO status.
-extern void SetSelect(int, unsigned int, PF *, void *, time_t);
+void SetSelect(int, unsigned int, PF *, void *, time_t);
 
 /// reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
-extern void ResetSelect(int);
+void ResetSelect(int);
 
 /** Perform a select() or equivalent call.
  * This is used by the main select loop engine to check for FD with IO available.
  */
-extern comm_err_t DoSelect(int);
+comm_err_t DoSelect(int);
 
-extern void QuickPollRequired(void);
+void QuickPollRequired(void);
 
 /**
  * Max number of UDP messages to receive per call to the UDP receive poller.
index 4a3d2f07a973e14e3f71618d38a7bf581e5dc773..1347bd8839df22102a5959be5e282accdcb32c88 100644 (file)
@@ -40,6 +40,7 @@
 #include "ICP.h"
 #include "mgr/Registration.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "Store.h"
index 5585520e346ee5cd0e62477bce44f257205caeb2..81e8a29839be1131be37ec1eae739962694fe642 100644 (file)
@@ -43,6 +43,7 @@
 #include "StatCounters.h"
 #include "StatHist.h"
 #include "Store.h"
+#include "SquidConfig.h"
 
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
index b383a3d5c79453c91ff41c2f618b9e0ba3b2af6a..6f388157a93ab872f71d1f81e868413317a446a8 100644 (file)
@@ -46,6 +46,7 @@
 #include "globals.h"
 #include "ip/Intercept.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 
index a32854506068719018c487b2249de1a590ff43b5..b0f8efb9901018c2a6f2ceb012911dbf5e157c59 100644 (file)
@@ -11,6 +11,6 @@ struct _fd_debug_t {
 typedef struct _fd_debug_t fd_debug_t;
 extern fd_debug_t *fdd_table;
 
-extern bool isOpen(const int fd);
+bool isOpen(const int fd);
 
 #endif
index 21b127de5b55cdd1ec55f307f8b5b018cfe70062..1e2595acc3217d2288ff6fc5a03534682822edb4 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "comm/Loops.h"
+#include "disk.h"
 #include "fd.h"
 #include "fde.h"
 #include "globals.h"
index 985af5ae3add3daf3e508550beac275bb9a3db15..9910fdbdeedd2595ba6d797f3211d4cbdbaf8f18 100644 (file)
 #include "typedefs.h"
 
 class MemBuf;
+// POD
 
-extern int file_open(const char *path, int mode);
-extern void file_close(int fd);
+class dread_ctrl
+{
+public:
+    int fd;
+    off_t offset;
+    int req_len;
+    char *buf;
+    int end_of_file;
+    DRCB *handler;
+    void *client_data;
+};
+
+
+int file_open(const char *path, int mode);
+void file_close(int fd);
 
 /* Adapter file_write for object callbacks */
 template <class O>
@@ -49,11 +63,11 @@ FreeObject(void *address)
     delete anObject;
 }
 
-extern void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *);
-extern void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data);
-extern void file_read(int, char *, int, off_t, DRCB *, void *);
-extern void disk_init(void);
-extern void safeunlink(const char *path, int quiet);
-extern int xrename(const char *from, const char *to); //disk.cc
+void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *);
+void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data);
+void file_read(int, char *, int, off_t, DRCB *, void *);
+void disk_init(void);
+void safeunlink(const char *path, int quiet);
+int xrename(const char *from, const char *to); //disk.cc
 
 #endif /* SQUID_DISK_H_ */
index 10a2e967ccf6906a5b40771bb2bd6ee19e64dc7e..d4a8bb361a66e323bdce39b0b5aeb23ae8f92012 100644 (file)
@@ -48,11 +48,11 @@ struct dlink_list {
 
 extern dlink_list ClientActiveRequests;
 
-SQUIDCEXTERN void dlinkAdd(void *data, dlink_node *, dlink_list *);
-SQUIDCEXTERN void dlinkAddAfter(void *, dlink_node *, dlink_node *, dlink_list *);
-SQUIDCEXTERN void dlinkAddTail(void *data, dlink_node *, dlink_list *);
-SQUIDCEXTERN void dlinkDelete(dlink_node * m, dlink_list * list);
-SQUIDCEXTERN void dlinkNodeDelete(dlink_node * m);
-SQUIDCEXTERN dlink_node *dlinkNodeNew(void);
+void dlinkAdd(void *data, dlink_node *, dlink_list *);
+void dlinkAddAfter(void *, dlink_node *, dlink_node *, dlink_list *);
+void dlinkAddTail(void *data, dlink_node *, dlink_list *);
+void dlinkDelete(dlink_node * m, dlink_list * list);
+void dlinkNodeDelete(dlink_node * m);
+dlink_node *dlinkNodeNew(void);
 
 #endif /* SQUID_DLINK_H */
index 43f8dd94b9d233ff6eebb21435c3b1fdbd9e76d2..31b83d18a9da23b186f37e059308e6f706260abc 100644 (file)
  */
 
 #include "squid.h"
+#include "helper.h"
+#include "mgr/Registration.h"
+#include "SquidConfig.h"
+#include "SquidTime.h"
 #include "Store.h"
 #include "wordlist.h"
-#include "SquidTime.h"
-#include "mgr/Registration.h"
-#include "helper.h"
 
 /* MS VisualStudio Projects are monolitich, so we need the following
    #if to include the external DNS code in compile process when
index 1c53518001f5e9b7cabb74ae6fbdf579838649a9..27578b0dafc80d12399367e966460b358d898495 100644 (file)
@@ -45,6 +45,7 @@
 #include "MemBuf.h"
 #include "mgr/Registration.h"
 #include "rfc3596.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "tools.h"
index d255d0eb74df343e832c01fe07c194cbc2b889ed..90ab3df1eca032f7fb50847b0010aedf18b19aec 100644 (file)
@@ -32,8 +32,6 @@
 #ifndef SQUID_ENUMS_H
 #define SQUID_ENUMS_H
 
-#include "HttpStatusCode.h"
-
 typedef enum {
     LOG_TAG_NONE,
     LOG_TCP_HIT,
@@ -192,8 +190,7 @@ enum {
     SNMP_C_USER,
     SNMP_C_COMMUNITY
 };
-
-#endif
+#endif /* SQUID_SNMP */
 
 typedef enum {
     MEM_NONE,
@@ -318,7 +315,7 @@ enum {
     _WIN_OS_WINLON,
     _WIN_OS_WIN7
 };
-#endif
+#endif /* _SQUID_WINDOWS_ */
 
 enum {
     DISABLE_PMTU_OFF,
@@ -334,6 +331,6 @@ typedef enum {
     HTCP_CLR_PURGE,
     HTCP_CLR_INVALIDATION
 } htcp_clr_reason;
-#endif
+#endif /* USE_HTCP */
 
 #endif /* SQUID_ENUMS_H */
index 0b596368a610a2206615c94b782f885d2b4db5bd..aeb3e299a71c2da65cfc9d920eae5b627b85dc6e 100644 (file)
@@ -46,6 +46,7 @@
 #include "fde.h"
 #include "MemBuf.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "URL.h"
 #include "URLScheme.h"
 #include "URL.h"
@@ -630,7 +631,7 @@ errorAppendEntry(StoreEntry * entry, ErrorState * err)
     if (err->page_id == TCP_RESET) {
         if (err->request) {
             debugs(4, 2, "RSTing this reply");
-            err->request->flags.setResetTCP();
+            err->request->flags.resetTcp=true;
         }
     }
 
index 8e739eb194bc3d2668516c5fce03610641251dcf..0103f4a123118298f1909c074df744f3f1118830 100644 (file)
 #include "comm/forward.h"
 #include "err_detail_type.h"
 #include "err_type.h"
+#include "HttpStatusCode.h"
 #include "ip/Address.h"
-#include "MemBuf.h"
 #include "SquidString.h"
-#if USE_AUTH
+/* auth/UserRequest.h is empty unless USE_AUTH is defined */
 #include "auth/UserRequest.h"
-#endif
 #if USE_SSL
 #include "ssl/ErrorDetail.h"
 #endif
index 7b9955724a07b8b7f45f09047e32e9b05c67f31a..7995c4a7d90e9c910e4577e630a188a455e8d7ed 100644 (file)
@@ -36,6 +36,7 @@
 #include "esi/Element.h"
 #include "clientStream.h"
 #include "err_type.h"
+#include "HttpStatusCode.h"
 
 class ESIVarState;
 class ClientHttpRequest;
index 0d8005642f242681f4e7fa4100d4abc655408c8f..050a46e032426384a6d9814e9f6051d6f07aede6 100644 (file)
@@ -60,6 +60,7 @@
 #include "Mem.h"
 #include "MemBuf.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 
 /* quick reference on behaviour here.
  * The ESI specification 1.0 requires the ESI processor to be able to
index 59406b0ad28550bc58bb339ed965b5263ce00219..466c923ddecf8e7e71ee81bd7786a0e1d6e91683 100644 (file)
@@ -39,6 +39,6 @@ extern CSR esiStreamRead;
 extern CSCB esiProcessStream;
 extern CSD esiStreamDetach;
 extern CSS esiStreamStatus;
-extern int esiEnableProcessing (HttpReply *);
+int esiEnableProcessing (HttpReply *);
 
 #endif /* SQUID_ESI_H */
index fb2069ff0bd583d62ceae211d8fd7af88364f92c..be338ba12a82c5a42b1feca91134d217eb59fbd6 100644 (file)
@@ -4,8 +4,8 @@
 namespace Esi
 {
 
-extern void Init();
-extern void Clean();
+void Init();
+void Clean();
 
 } // namespace Esi
 
index 892e5ff7d6e7c22a51b9093bffaf89bf9985fffb..04e0ce46177741d44560a0c522a56faac3ac07ef 100644 (file)
@@ -72,6 +72,6 @@ private:
     void dumpOne() const;
 };
 
-extern void ESISegmentFreeList (ESISegment::Pointer &head);
+void ESISegmentFreeList (ESISegment::Pointer &head);
 
 #endif /* SQUID_ESISEGMENT_H */
index 40faef0545db3947b1fae7e8a23b82db64e9259d..4101d3d08e555fb42281a177782c5d70c090f059 100644 (file)
@@ -37,6 +37,8 @@
 #include "Array.h"
 #include "HttpHeader.h"
 
+class HttpReply;
+
 /* esi variable replacement logic */
 
 typedef enum {
index 23e4d11bbafdb2af6315709d9dcf857b4cfd4b00..aa269292a26b21612b004852d4cb80594f397e40 100644 (file)
@@ -35,9 +35,6 @@
 #include "Array.h"
 #include "AsyncEngine.h"
 #include "MemPool.h"
-#include "RefCount.h"
-
-/* forward decls */
 
 class StoreEntry;
 
@@ -45,12 +42,12 @@ class StoreEntry;
 
 typedef void EVH(void *);
 
-extern void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata=true);
-SQUIDCEXTERN void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int);
-SQUIDCEXTERN void eventDelete(EVH * func, void *arg);
-SQUIDCEXTERN void eventInit(void);
-SQUIDCEXTERN void eventFreeMemory(void);
-SQUIDCEXTERN int eventFind(EVH *, void *);
+void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata=true);
+void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int);
+void eventDelete(EVH * func, void *arg);
+void eventInit(void);
+void eventFreeMemory(void);
+int eventFind(EVH *, void *);
 
 class ev_entry
 {
index 59ffbc19b0ee04e12d365635b0d12bb7e193137f..b9cb7d19d841274f875386eca8c84578495e9899 100644 (file)
@@ -55,6 +55,7 @@
 #include "MemBuf.h"
 #include "mgr/Registration.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidString.h"
 #include "SquidTime.h"
 #include "Store.h"
index 316f244f1d7e15d1fbdc181e1ed6d263e03f09cb..89483415637a079c1bd15e7f8f81544a0e077c99 100644 (file)
--- a/src/fd.h
+++ b/src/fd.h
 #ifndef SQUID_FD_H_
 #define SQUID_FD_H_
 
-extern void fd_close(int fd);
-extern void fd_open(int fd, unsigned int type, const char *);
-extern void fd_note(int fd, const char *);
-extern void fd_bytes(int fd, int len, unsigned int type);
-extern void fdDumpOpen(void);
-extern int fdUsageHigh(void);
-extern void fdAdjustReserved(void);
+void fd_close(int fd);
+void fd_open(int fd, unsigned int type, const char *);
+void fd_note(int fd, const char *);
+void fd_bytes(int fd, int len, unsigned int type);
+void fdDumpOpen(void);
+int fdUsageHigh(void);
+void fdAdjustReserved(void);
 
 #endif /* SQUID_FD_H_ */
index a78cff4cd3c7a610a25b5e5718c456c1dd720aee..b0f2ee17d40827fb20bb9c5b0874453924a2a8d7 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
 #include "ip/Address.h"
 #include "structs.h"
 
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
+
 #if USE_DELAY_POOLS
 class ClientInfo;
 #endif
index aa88160bf238952e9ef817a46b14cceafdf9a3fc..260c02fdae2aecac55377d8a22b91608118a4743 100644 (file)
@@ -383,7 +383,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
         case LFT_LOCAL_LISTENING_IP: {
             // avoid logging a dash if we have reliable info
             const bool interceptedAtKnownPort = al->request ?
-                                                (al->request->flags.spoof_client_ip ||
+                                                (al->request->flags.spoofClientIp ||
                                                  al->request->flags.intercepted) && al->cache.port :
                                                 false;
             if (interceptedAtKnownPort) {
index 2b6e78d837e2649dc4815855689ddb93870d6878..c4c3c6b198bb6e6d1eb9d14621a728b00e191ec5 100644 (file)
@@ -6,13 +6,13 @@ namespace Format
 
 /// Safely URL-encode a username.
 /// Accepts NULL or empty strings.
-extern char * QuoteUrlEncodeUsername(const char *name);
+char * QuoteUrlEncodeUsername(const char *name);
 
 /** URL-style encoding on a MIME headers blob.
  * May accept NULL or empty strings.
  * \return A dynamically allocated string. recipient is responsible for free()'ing
  */
-extern char *QuoteMimeBlob(const char *header);
+char *QuoteMimeBlob(const char *header);
 
 }; // namespace Format
 
index bf18b7a3e266e61b2bc3f08449cbe43e245ca337..adea6bc852506e68c30619851b9ba0c5723ccae6 100644 (file)
@@ -2,6 +2,7 @@
 #include "format/Config.h"
 #include "format/Token.h"
 #include "format/TokenTableEntry.h"
+#include "SquidConfig.h"
 #include "Store.h"
 
 const char *Format::log_tags[] = {
index 4ad233451e8e857e1aa80ef53b5ef3caf76b5144..35c0670a45fa60ab8fb44e1eba6a61f6f05dac64 100644 (file)
 
 #include "squid.h"
 #include "AccessLogEntry.h"
+#include "acl/AclAddress.h"
 #include "acl/FilledChecklist.h"
 #include "acl/Gadgets.h"
 #include "anyp/PortCfg.h"
+#include "CachePeer.h"
 #include "CacheManager.h"
 #include "client_side.h"
 #include "comm/Connection.h"
@@ -63,6 +65,7 @@
 #include "neighbors.h"
 #include "pconn.h"
 #include "PeerSelectState.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StoreClient.h"
@@ -144,7 +147,7 @@ void FwdState::start(Pointer aSelf)
     // Bug 3243: CVE 2009-0801
     // Bypass of browser same-origin access control in intercepted communication
     // To resolve this we must force DIRECT and only to the original client destination.
-    const bool isIntercepted = request && !request->flags.redirected && (request->flags.intercepted || request->flags.spoof_client_ip);
+    const bool isIntercepted = request && !request->flags.redirected && (request->flags.intercepted || request->flags.spoofClientIp);
     const bool useOriginalDst = Config.onoff.client_dst_passthru || (request && !request->flags.hostVerified);
     if (isIntercepted && useOriginalDst) {
         selectPeerForIntercepted();
@@ -562,12 +565,6 @@ FwdState::checkRetry()
 bool
 FwdState::checkRetriable()
 {
-    // Optimize: A compliant proxy may retry PUTs, but Squid lacks the [rather
-    // complicated] code required to protect the PUT request body from being
-    // nibbled during the first try. Thus, Squid cannot retry some PUTs today.
-    if (request->body_pipe != NULL)
-        return false;
-
     /* RFC2616 9.1 Safe and Idempotent Methods */
     switch (request->method.id()) {
         /* 9.1.1 Safe Methods */
@@ -767,7 +764,7 @@ FwdState::initiateSSL()
 {
     SSL *ssl;
     SSL_CTX *sslContext = NULL;
-    const peer *peer = serverConnection()->getPeer();
+    const CachePeer *peer = serverConnection()->getPeer();
     int fd = serverConnection()->fd;
 
     if (peer) {
@@ -956,7 +953,7 @@ FwdState::connectStart()
     if (ftimeout < ctimeout)
         ctimeout = ftimeout;
 
-    if (serverDestinations[0]->getPeer() && request->flags.sslBumped == true) {
+    if (serverDestinations[0]->getPeer() && request->flags.sslBumped) {
         debugs(50, 4, "fwdConnectStart: Ssl bumped connections through parrent proxy are not allowed");
         ErrorState *anErr = new ErrorState(ERR_CANNOT_FORWARD, HTTP_SERVICE_UNAVAILABLE, request);
         fail(anErr);
@@ -1254,7 +1251,7 @@ FwdState::reforward()
 ErrorState *
 FwdState::makeConnectingError(const err_type type) const
 {
-    return new ErrorState(type, request->flags.need_validation ?
+    return new ErrorState(type, request->flags.needValidation ?
                           HTTP_GATEWAY_TIMEOUT : HTTP_SERVICE_UNAVAILABLE, request);
 }
 
@@ -1400,7 +1397,7 @@ getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn)
         conn->local.SetIPv4();
 
     // maybe use TPROXY client address
-    if (request && request->flags.spoof_client_ip) {
+    if (request && request->flags.spoofClientIp) {
         if (!conn->getPeer() || !conn->getPeer()->options.no_tproxy) {
 #if FOLLOW_X_FORWARDED_FOR && LINUX_NETFILTER
             if (Config.onoff.tproxy_uses_indirect_client)
@@ -1427,7 +1424,7 @@ getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn)
     // TODO use the connection details in ACL.
     // needs a bit of rework in ACLFilledChecklist to use Comm::Connection instead of ConnStateData
 
-    acl_address *l;
+    AclAddress *l;
     for (l = Config.accessList.outgoing_address; l; l = l->next) {
 
         /* check if the outgoing address is usable to the destination */
index c8a4adcf3d656ac49c3fa9027d0d668997185ff6..da3e74a427af5c3baa005ad6350d9478bf2f072b 100644 (file)
@@ -4,7 +4,9 @@
 #include "Array.h"
 #include "comm.h"
 #include "comm/Connection.h"
+#include "err_type.h"
 #include "fde.h"
+#include "HttpStatusCode.h"
 #include "ip/Address.h"
 #include "RefCount.h"
 
@@ -123,6 +125,6 @@ private:
     CBDATA_CLASS2(FwdState);
 };
 
-extern void getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn);
+void getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn);
 
 #endif /* SQUID_FORWARD_H */
index 32d284be69735c94bc7b26567c770095a73e6e88..2530ac85520eb50b7c34cbe10220d8f36267e4bd 100644 (file)
@@ -36,6 +36,7 @@
 #include "event.h"
 #include "Mem.h"
 #include "mgr/Registration.h"
+#include "SquidConfig.h"
 #include "SquidDns.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
index e2614167112087269a45bafdf22646514dbf3beb..0592a89f87c6fddde2ac2b9a7279f67ac1f231ff 100644 (file)
 class StoreEntry;
 class wordlist;
 
-extern void fqdncache_init(void);
+void fqdncache_init(void);
 void fqdnStats(StoreEntry *);
 //extern void fqdncacheReleaseInvalid(const char *);
 //extern int fqdncacheQueueDrain(void);
-extern void fqdncacheFreeMemory(void);
-extern void fqdncache_restart(void);
-extern void fqdncache_purgelru(void *);
-extern void fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames);
+void fqdncacheFreeMemory(void);
+void fqdncache_restart(void);
+void fqdncache_purgelru(void *);
+void fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames);
 
-extern const char *fqdncache_gethostbyaddr(const Ip::Address &, int flags);
+const char *fqdncache_gethostbyaddr(const Ip::Address &, int flags);
 //extern const char *fqdnFromAddr(const Ip::Address &);
-extern void fqdncache_nbgethostbyaddr(const Ip::Address &, FQDNH *, void *);
+void fqdncache_nbgethostbyaddr(const Ip::Address &, FQDNH *, void *);
 
 #endif /* SQUID_FQDNCACHE_H_ */
index 9d7ab5db1c69120d282ce6bf8489a13533778b90..20276eb52223bb2042a84c9695b91ea81c7a5526 100644 (file)
@@ -4,8 +4,8 @@
 namespace Fs
 {
 
-extern void Init();
-extern void Clean();
+void Init();
+void Clean();
 
 } // namespace Fs
 
index 7f399f62fe97daabebee06846bc8debc083f025a..dc0100e90e5efed8c02253d34cb11aada48c9a27 100644 (file)
@@ -105,11 +105,11 @@ private:
 };
 
 /// \ingroup COSS
-extern void storeCossAdd(CossSwapDir *, StoreEntry *);
+void storeCossAdd(CossSwapDir *, StoreEntry *);
 /// \ingroup COSS
-extern void storeCossRemove(CossSwapDir *, StoreEntry *);
+void storeCossRemove(CossSwapDir *, StoreEntry *);
 /// \ingroup COSS
-extern void storeCossStartMembuf(CossSwapDir * SD);
+void storeCossStartMembuf(CossSwapDir * SD);
 
 #include "StoreSearch.h"
 
index 7f2ae9344dca13b458641da9cc98b5cae05b7d74..6601d20aa8c1bba5be74ed72f6072d25f9a26251 100644 (file)
@@ -52,6 +52,7 @@
 #include "store_key_md5.h"
 #include "swap_log_op.h"
 #include "store_rebuild.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 
 #if HAVE_ERRNO_H
@@ -76,7 +77,7 @@ struct _RebuildState {
         unsigned int clean:1;
     } flags;
 
-    struct _store_rebuild_data counts;
+    StoreRebuildData counts;
 };
 
 static char *storeCossDirSwapLogFile(SwapDir *, const char *);
index ab502b879005c4dae2d5aa2f957ae306453d3a1f..8aac78ee1295d8269c76219e258cec3e2cd15736 100644 (file)
 
 #include "squid.h"
 #include "CossSwapDir.h"
-#include "Store.h"
-#include "store_coss.h"
-#include "MemObject.h"
+#include "DiskIO/DiskIOStrategy.h"
 #include "fde.h"
-#include "SwapDir.h"
+#include "MemObject.h"
+#include "SquidConfig.h"
+#include "store_coss.h"
+#include "Store.h"
 #include "StoreFScoss.h"
-#include "DiskIO/DiskIOStrategy.h"
+#include "SwapDir.h"
 
 CBDATA_TYPE(CossMemBuf);
 
index 20d025156aedd1eb5226413d7573716fe0d1a0e1..f4864633bd40e33235cd774430d06032ec390ba6 100644 (file)
@@ -2,7 +2,8 @@
 #define SQUID_FS_ROCK_REBUILD_H
 
 #include "base/AsyncJob.h"
-#include "structs.h"
+#include "cbdata.h"
+#include "store_rebuild.h"
 
 namespace Rock
 {
@@ -39,7 +40,7 @@ private:
     int64_t dbOffset;
     int filen;
 
-    struct _store_rebuild_data counts;
+    StoreRebuildData counts;
 
     static void Steps(void *data);
 
index 04e3f9f1b98f7236db9b5c301ffd0545ee6f854b..50bb85105a3d82fcab2405dc543ab3ced7dcbebb 100644 (file)
@@ -17,6 +17,7 @@
 #include "ipc/mem/Pages.h"
 #include "MemObject.h"
 #include "Parsing.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "tools.h"
 
index f028bf19390f192e78015a917b9f7b95e94d19e9..141143ed28aa0fb957ce95627c5285c4b1cbd8c8 100644 (file)
@@ -34,6 +34,7 @@
 #include "disk.h"
 #include "globals.h"
 #include "RebuildState.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "store_key_md5.h"
 #include "store_rebuild.h"
index 9a7d7c5760159e98124958870020462bc5229b08..29f69fea2e4a86d381915fa7733cf391ed6fb171 100644 (file)
@@ -32,8 +32,8 @@
 
 #include "RefCount.h"
 #include "UFSSwapDir.h"
-#include "structs.h"
 #include "UFSSwapLogParser.h"
+#include "store_rebuild.h"
 
 class StoreEntry;
 
@@ -76,7 +76,7 @@ public:
     char fullpath[MAXPATHLEN];
     char fullfilename[MAXPATHLEN];
 
-    struct _store_rebuild_data counts;
+    StoreRebuildData counts;
 
 private:
     CBDATA_CLASS2(RebuildState);
index 3c2c017c1d1c01183cac86dc585cdf7e9317fd1d..3fa84bc4618a74ef767d06bd215c1237b0fd6c6a 100644 (file)
@@ -46,6 +46,7 @@
 #include "store_key_md5.h"
 #include "StoreSearchUFS.h"
 #include "StoreSwapLogData.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "tools.h"
index edda7de878a9baab8ed940fabc9278d50c98f620..ec3fca075c227269d7a9f55912b6df5c3f7c3938 100644 (file)
@@ -53,6 +53,7 @@
 #include "mime.h"
 #include "rfc1738.h"
 #include "Server.h"
+#include "SquidConfig.h"
 #include "SquidString.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
index e128c0a288b31905d84a4a8114b3125ce79bbac2..ca4140200d6fde1c603028318df851a164dd7ce9 100644 (file)
--- a/src/ftp.h
+++ b/src/ftp.h
@@ -41,8 +41,8 @@ class FwdState;
  */
 
 /// \ingroup ServerProtocolFTPAPI
-extern void ftpStart(FwdState *);
+void ftpStart(FwdState *);
 /// \ingroup ServerProtocolFTPAPI
-extern const char *ftpUrlWith2f(HttpRequest *);
+const char *ftpUrlWith2f(HttpRequest *);
 
 #endif /* SQUID_FTP_H_ */
index 8997454cf2723ed36c63f8311bf948c332314ea1..3980d926d880a0c895b0cc0b725f55d4582f7b54 100644 (file)
 #ifndef SQUID_GLOBALS_H
 #define SQUID_GLOBALS_H
 
+#include "acl/AclDenyInfoList.h"
+#include "CacheDigest.h"
+#include "defines.h"
+#include "hash.h"
+#include "IoStats.h"
+#include "rfc2181.h"
+
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
 
-#include "rfc2181.h"
-
-/* for ERROR_BUF_SZ, BUFSIZ */
-#include "defines.h"
-
-/* for iostats */
-#include "structs.h"
-
 extern char *ConfigFile;       /* NULL */
 extern char *IcpOpcodeStr[];
 extern char tmp_error_buf[ERROR_BUF_SZ];
@@ -85,9 +84,9 @@ extern int syslog_enable;     /* 0 */
 extern int DnsSocketA;         /* -1 */
 extern int DnsSocketB;         /* -1 */
 extern int n_disk_objects;     /* 0 */
-extern iostats IOStats;
+extern IoStats IOStats;
 
-extern struct acl_deny_info_list *DenyInfoList;        /* NULL */
+extern AclDenyInfoList *DenyInfoList;  /* NULL */
 
 extern struct timeval squid_start;
 extern int starting_up;        /* 1 */
index 9bd404584a479656e730ff3894501b9d8ee77dd3..ce165a9f3cdb5573112646129d4b2deb7169fe5e 100644 (file)
@@ -43,6 +43,7 @@
 #include "MemBuf.h"
 #include "mime.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "Store.h"
index 51e4659b3b37167075ceeda941683e29e5d2adee..02488ea05e772e4344b775dd30bc558ec3297df9 100644 (file)
@@ -42,9 +42,9 @@ class HttpRequest;
  */
 
 /// \ingroup ServerProtocolGopherAPI
-extern void gopherStart(FwdState *);
+void gopherStart(FwdState *);
 
 /// \ingroup ServerProtocolGopherAPI
-extern int gopherCachable(const HttpRequest *);
+int gopherCachable(const HttpRequest *);
 
 #endif /* SQUID_GOPHER_H_ */
index 327770131a5e6649a65e43115980474b856b52eb..26c4ca6831d537aac1bdc1ab34bed4b85074da61 100644 (file)
@@ -35,6 +35,7 @@
 #include "AccessLogEntry.h"
 #include "acl/Acl.h"
 #include "acl/FilledChecklist.h"
+#include "CachePeer.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "htcp.h"
 #include "http.h"
 #include "HttpRequest.h"
+#include "HttpStateFlags.h"
 #include "icmp/net_db.h"
 #include "ip/tools.h"
 #include "md5.h"
 #include "MemBuf.h"
 #include "refresh.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "store_key_md5.h"
@@ -1307,7 +1310,7 @@ htcpHandleClr(htcpDataHeader * hdr, char *buf, int sz, Ip::Address &from)
 static void
 htcpForwardClr(char *buf, int sz)
 {
-    peer *p;
+    CachePeer *p;
 
     for (p = Config.peers; p; p = p->next) {
         if (!p->options.htcp) {
@@ -1550,7 +1553,7 @@ htcpIncomingConnectionOpened(const Comm::ConnectionPointer &conn, int)
 }
 
 int
-htcpQuery(StoreEntry * e, HttpRequest * req, peer * p)
+htcpQuery(StoreEntry * e, HttpRequest * req, CachePeer * p)
 {
     cache_key *save_key;
     static char pkt[8192];
@@ -1560,7 +1563,7 @@ htcpQuery(StoreEntry * e, HttpRequest * req, peer * p)
     HttpHeader hdr(hoRequest);
     Packer pa;
     MemBuf mb;
-    http_state_flags flags;
+    HttpStateFlags flags;
 
     if (!Comm::IsConnOpen(htcpIncomingConn))
         return 0;
@@ -1603,10 +1606,10 @@ htcpQuery(StoreEntry * e, HttpRequest * req, peer * p)
 }
 
 /*
- * Send an HTCP CLR message for a specified item to a given peer.
+ * Send an HTCP CLR message for a specified item to a given CachePeer.
  */
 void
-htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, peer * p, htcp_clr_reason reason)
+htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, CachePeer * p, htcp_clr_reason reason)
 {
     static char pkt[8192];
     ssize_t pktlen;
@@ -1615,7 +1618,7 @@ htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestM
     HttpHeader hdr(hoRequest);
     Packer pa;
     MemBuf mb;
-    http_state_flags flags;
+    HttpStateFlags flags;
 
     if (!Comm::IsConnOpen(htcpIncomingConn))
         return;
index 368709ff5bc9a2d8bd5e7fb0a412e7684881d06a..631d1c0f5e058d1b9ff6c6a77b851677c4f38bc4 100644 (file)
@@ -61,10 +61,10 @@ public:
 typedef class HtcpReplyData htcpReplyData;
 
 /// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const Ip::Address &);
+void neighborsHtcpReply(const cache_key *, htcpReplyData *, const Ip::Address &);
 
 /// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void htcpOpenPorts(void);
+void htcpOpenPorts(void);
 
 /**
  * \ingroup ServerProtocolHTCP
@@ -79,16 +79,16 @@ SQUIDCEXTERN void htcpOpenPorts(void);
  *             Don't wait for a reply or count in stats as sent.
  * \retval -1   Error sending request.
  */
-SQUIDCEXTERN int htcpQuery(StoreEntry * e, HttpRequest * req, peer * p);
+int htcpQuery(StoreEntry * e, HttpRequest * req, CachePeer * p);
 
 /// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, peer * p, htcp_clr_reason reason);
+void htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, CachePeer * p, htcp_clr_reason reason);
 
 /// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void htcpSocketShutdown(void);
+void htcpSocketShutdown(void);
 
 /// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void htcpClosePorts(void);
+void htcpClosePorts(void);
 
 #endif /* USE_HTCP */
 
index 4ac95981b783df427ccbdd51a1c777fe04729656..33082c3159b26f863ac68f0afc652ba6e0b2f7f1 100644 (file)
@@ -39,6 +39,8 @@
 #include "base64.h"
 #include "base/AsyncJobCalls.h"
 #include "base/TextException.h"
+#include "CachePeer.h"
+#include "ChunkedCodingParser.h"
 #include "client_side.h"
 #include "comm/Connection.h"
 #include "comm/Write.h"
@@ -56,6 +58,7 @@
 #include "HttpHeaderTools.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
+#include "HttpStateFlags.h"
 #include "log/access_log.h"
 #include "MemBuf.h"
 #include "MemObject.h"
@@ -64,7 +67,9 @@
 #include "peer_proxy_negotiate_auth.h"
 #include "profiler/Profiler.h"
 #include "refresh.h"
+#include "RefreshPattern.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "Store.h"
@@ -94,7 +99,7 @@ static const char *const crlf = "\r\n";
 
 static void httpMaybeRemovePublic(StoreEntry *, http_status);
 static void copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, const String strConnection, const HttpRequest * request,
-        HttpHeader * hdr_out, const int we_do_ranges, const http_state_flags);
+        HttpHeader * hdr_out, const int we_do_ranges, const HttpStateFlags &);
 //Declared in HttpHeaderTools.cc
 void httpHdrAdd(HttpHeader *heads, HttpRequest *request, const AccessLogEntryPointer &al, HeaderWithAclList &headers_add);
 
@@ -335,7 +340,7 @@ HttpStateData::cacheableReply()
     const char *v;
 #if USE_HTTP_VIOLATIONS
 
-    const refresh_t *R = NULL;
+    const RefreshPattern *R = NULL;
 
     /* This strange looking define first looks up the refresh pattern
      * and then checks if the specified flag is set. The main purpose
@@ -376,7 +381,7 @@ HttpStateData::cacheableReply()
         }
     }
 
-    if (request->flags.auth || request->flags.auth_sent) {
+    if (request->flags.auth || request->flags.authSent) {
         /*
          * Responses to requests with authorization may be cached
          * only if a Cache-Control: public reply header is present.
@@ -618,7 +623,7 @@ HttpStateData::keepaliveAccounting(HttpReply *reply)
                 && reply->bodySize(request->method) == -1 && !flags.chunked) {
             debugs(11, DBG_IMPORTANT, "keepaliveAccounting: Impossible keep-alive header from '" << entry->url() << "'" );
             // debugs(11, 2, "GOT HTTP REPLY HDR:\n---------\n" << readBuf->content() << "\n----------" );
-            flags.keepalive_broken = 1;
+            flags.keepalive_broken = true;
         }
     }
 }
@@ -674,7 +679,7 @@ HttpStateData::processReplyHeader()
     } else {
         if (!parsed && error > 0) { // unrecoverable parsing error
             debugs(11, 3, "processReplyHeader: Non-HTTP-compliant header: '" <<  readBuf->content() << "'");
-            flags.headers_parsed = 1;
+            flags.headers_parsed = true;
             newrep->sline.version = HttpVersion(1,1);
             newrep->sline.status = error;
             HttpReply *vrep = setVirginReply(newrep);
@@ -706,17 +711,17 @@ HttpStateData::processReplyHeader()
         return;
     }
 
-    flags.chunked = 0;
+    flags.chunked = false;
     if (newrep->sline.protocol == AnyP::PROTO_HTTP && newrep->header.chunked()) {
-        flags.chunked = 1;
+        flags.chunked = true;
         httpChunkDecoder = new ChunkedCodingParser;
     }
 
     if (!peerSupportsConnectionPinning())
-        request->flags.connection_auth_disabled = 1;
+        request->flags.connectionAuthDisabled = 1;
 
     HttpReply *vrep = setVirginReply(newrep);
-    flags.headers_parsed = 1;
+    flags.headers_parsed = true;
 
     keepaliveAccounting(vrep);
 
@@ -1064,7 +1069,7 @@ HttpStateData::readReply(const CommIoCbParams &io)
     int clen;
     int len = io.size;
 
-    flags.do_next_read = 0;
+    flags.do_next_read = false;
 
     debugs(11, 5, HERE << io.conn << ": len " << len << ".");
 
@@ -1084,12 +1089,12 @@ HttpStateData::readReply(const CommIoCbParams &io)
         debugs(11, 2, HERE << io.conn << ": read failure: " << xstrerror() << ".");
 
         if (ignoreErrno(io.xerrno)) {
-            flags.do_next_read = 1;
+            flags.do_next_read = true;
         } else {
             ErrorState *err = new ErrorState(ERR_READ_ERROR, HTTP_BAD_GATEWAY, fwd->request);
             err->xerrno = io.xerrno;
             fwd->fail(err);
-            flags.do_next_read = 0;
+            flags.do_next_read = false;
             serverConnection->close();
         }
 
@@ -1132,7 +1137,7 @@ HttpStateData::readReply(const CommIoCbParams &io)
 
     if (len == 0) { // reached EOF?
         eof = 1;
-        flags.do_next_read = 0;
+        flags.do_next_read = false;
 
         /* Bug 2879: Replies may terminate with \r\n then EOF instead of \r\n\r\n
          * Ensure here that we have at minimum two \r\n when EOF is seen.
@@ -1196,7 +1201,7 @@ HttpStateData::continueAfterParsingHeader()
 
     if (!flags.headers_parsed && !eof) {
         debugs(11, 9, HERE << "needs more at " << readBuf->contentSize());
-        flags.do_next_read = 1;
+        flags.do_next_read = true;
         /** \retval false If we have not finished parsing the headers and may get more data.
          *                Schedules more reads to retrieve the missing data.
          */
@@ -1242,7 +1247,7 @@ HttpStateData::continueAfterParsingHeader()
     assert(error != ERR_NONE);
     entry->reset();
     fwd->fail(new ErrorState(error, HTTP_BAD_GATEWAY, fwd->request));
-    flags.do_next_read = 0;
+    flags.do_next_read = false;
     serverConnection->close();
     return false; // quit on error
 }
@@ -1305,7 +1310,7 @@ HttpStateData::decodeAndWriteReplyBody()
     addVirginReplyBody(data, len);
     if (doneParsing) {
         lastChunk = 1;
-        flags.do_next_read = 0;
+        flags.do_next_read = false;
     }
     SQUID_EXIT_THROWING_CODE(wasThereAnException);
     return wasThereAnException;
@@ -1325,7 +1330,7 @@ HttpStateData::processReplyBody()
     bool ispinned = false;
 
     if (!flags.headers_parsed) {
-        flags.do_next_read = 1;
+        flags.do_next_read = true;
         maybeReadVirginBody();
         return;
     }
@@ -1345,7 +1350,7 @@ HttpStateData::processReplyBody()
     if (entry->isAccepting()) {
         if (flags.chunked) {
             if (!decodeAndWriteReplyBody()) {
-                flags.do_next_read = 0;
+                flags.do_next_read = false;
                 serverComplete();
                 return;
             }
@@ -1369,7 +1374,7 @@ HttpStateData::processReplyBody()
                 commSetConnTimeout(serverConnection, Config.Timeout.read, nil);
             }
 
-            flags.do_next_read = 1;
+            flags.do_next_read = true;
         }
         break;
 
@@ -1377,24 +1382,24 @@ HttpStateData::processReplyBody()
             debugs(11, 5, "processReplyBody: COMPLETE_PERSISTENT_MSG from " << serverConnection);
             /* yes we have to clear all these! */
             commUnsetConnTimeout(serverConnection);
-            flags.do_next_read = 0;
+            flags.do_next_read = false;
 
             comm_remove_close_handler(serverConnection->fd, closeHandler);
             closeHandler = NULL;
             fwd->unregister(serverConnection);
 
-            if (request->flags.spoof_client_ip)
+            if (request->flags.spoofClientIp)
                 client_addr = request->client_addr;
 
             if (request->flags.pinned) {
                 ispinned = true;
-            } else if (request->flags.connection_auth && request->flags.auth_sent) {
+            } else if (request->flags.connectionAuth && request->flags.authSent) {
                 ispinned = true;
             }
 
             if (request->pinnedConnection() && ispinned) {
                 request->pinnedConnection()->pinConnection(serverConnection, request, _peer,
-                        (request->flags.connection_auth != 0));
+                        (request->flags.connectionAuth != 0));
             } else {
                 fwd->pconnPush(serverConnection, request->peer_host ? request->peer_host : request->GetHost());
             }
@@ -1438,7 +1443,7 @@ HttpStateData::maybeReadVirginBody()
         return;
 
     if (flags.do_next_read) {
-        flags.do_next_read = 0;
+        flags.do_next_read = false;
         typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
         entry->delayAwareRead(serverConnection, readBuf->space(read_size), read_size,
                               JobCallback(11, 5, Dialer, this,  HttpStateData::readReply));
@@ -1492,9 +1497,7 @@ HttpStateData::sendComplete()
                                       TimeoutDialer, this, HttpStateData::httpTimeout);
 
     commSetConnTimeout(serverConnection, Config.Timeout.read, timeoutCall);
-
-    flags.request_sent = 1;
-
+    flags.request_sent = true;
     request->hier.peer_http_request_sent = current_time;
 }
 
@@ -1522,7 +1525,7 @@ HttpStateData::doneWithServer() const
  * Fixup authentication request headers for special cases
  */
 static void
-httpFixupAuthentication(HttpRequest * request, const HttpHeader * hdr_in, HttpHeader * hdr_out, http_state_flags flags)
+httpFixupAuthentication(HttpRequest * request, const HttpHeader * hdr_in, HttpHeader * hdr_out, const HttpStateFlags &flags)
 {
     http_hdr_type header = flags.originpeer ? HDR_AUTHORIZATION : HDR_PROXY_AUTHORIZATION;
 
@@ -1618,7 +1621,7 @@ HttpStateData::httpBuildRequestHeader(HttpRequest * request,
                                       StoreEntry * entry,
                                       const AccessLogEntryPointer &al,
                                       HttpHeader * hdr_out,
-                                      const http_state_flags flags)
+                                      const HttpStateFlags &flags)
 {
     /* building buffer for complex strings */
 #define BBUF_SZ (MAX_URL+32)
@@ -1649,7 +1652,7 @@ HttpStateData::httpBuildRequestHeader(HttpRequest * request,
         /* pretend it's not a range request */
         delete request->range;
         request->range = NULL;
-        request->flags.range = 0;
+        request->flags.isRanged=false;
     }
 
     /* append Via */
@@ -1804,7 +1807,7 @@ HttpStateData::httpBuildRequestHeader(HttpRequest * request,
  * to our outgoing fetch request.
  */
 void
-copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, const String strConnection, const HttpRequest * request, HttpHeader * hdr_out, const int we_do_ranges, const http_state_flags flags)
+copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, const String strConnection, const HttpRequest * request, HttpHeader * hdr_out, const int we_do_ranges, const HttpStateFlags &flags)
 {
     debugs(11, 5, "httpBuildRequestHeader: " << e->name << ": " << e->value );
 
@@ -1985,7 +1988,7 @@ HttpStateData::decideIfWeDoRanges (HttpRequest * request)
     int64_t roffLimit = request->getRangeOffsetLimit();
 
     if (NULL == request->range || !request->flags.cachable
-            || request->range->offsetLimitExceeded(roffLimit) || request->flags.connection_auth)
+            || request->range->offsetLimitExceeded(roffLimit) || request->flags.connectionAuth)
         result = false;
 
     debugs(11, 8, "decideIfWeDoRanges: range specs: " <<
@@ -2018,10 +2021,10 @@ HttpStateData::buildRequestPrefix(MemBuf * mb)
         Packer p;
         httpBuildRequestHeader(request, entry, fwd->al, &hdr, flags);
 
-        if (request->flags.pinned && request->flags.connection_auth)
-            request->flags.auth_sent = 1;
+        if (request->flags.pinned && request->flags.connectionAuth)
+            request->flags.authSent = 1;
         else if (hdr.has(HDR_AUTHORIZATION))
-            request->flags.auth_sent = 1;
+            request->flags.authSent = 1;
 
         packerToMemInit(&p, mb);
         hdr.packInto(&p);
@@ -2051,7 +2054,7 @@ HttpStateData::sendRequest()
     AsyncCall::Pointer timeoutCall =  JobCallback(11, 5,
                                       TimeoutDialer, this, HttpStateData::httpTimeout);
     commSetConnTimeout(serverConnection, Config.Timeout.lifetime, timeoutCall);
-    flags.do_next_read = 1;
+    flags.do_next_read = true;
     maybeReadVirginBody();
 
     if (request->body_pipe != NULL) {
@@ -2064,7 +2067,7 @@ HttpStateData::sendRequest()
         Must(!flags.chunked_request);
         // use chunked encoding if we do not know the length
         if (request->content_length < 0)
-            flags.chunked_request = 1;
+            flags.chunked_request = true;
     } else {
         assert(!requestBodySource);
         typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
@@ -2074,31 +2077,31 @@ HttpStateData::sendRequest()
 
     if (_peer != NULL) {
         if (_peer->options.originserver) {
-            flags.proxying = 0;
-            flags.originpeer = 1;
+            flags.proxying = false;
+            flags.originpeer = true;
         } else {
-            flags.proxying = 1;
-            flags.originpeer = 0;
+            flags.proxying = false;
+            flags.originpeer = false;
         }
     } else {
-        flags.proxying = 0;
-        flags.originpeer = 0;
+        flags.proxying = false;
+        flags.originpeer = false;
     }
 
     /*
      * Is keep-alive okay for all request methods?
      */
-    if (request->flags.must_keepalive)
-        flags.keepalive = 1;
+    if (request->flags.mustKeepalive)
+        flags.keepalive = true;
     else if (!Config.onoff.server_pconns)
-        flags.keepalive = 0;
+        flags.keepalive = false;
     else if (_peer == NULL)
-        flags.keepalive = 1;
+        flags.keepalive = true;
     else if (_peer->stats.n_keepalives_sent < 10)
-        flags.keepalive = 1;
+        flags.keepalive = true;
     else if ((double) _peer->stats.n_keepalives_recv /
              (double) _peer->stats.n_keepalives_sent > 0.50)
-        flags.keepalive = 1;
+        flags.keepalive = true;
 
     if (_peer) {
         /*The old code here was
@@ -2114,7 +2117,7 @@ HttpStateData::sendRequest()
          */
         if (neighborType(_peer, request) == PEER_SIBLING &&
                 !_peer->options.allow_miss)
-            flags.only_if_cached = 1;
+            flags.only_if_cached = true;
 
         flags.front_end_https = _peer->front_end_https;
     }
@@ -2274,7 +2277,7 @@ HttpStateData::handleMoreRequestBodyAvailable()
         // XXX: why does not this trigger a debug message on every request?
 
         if (flags.headers_parsed && !flags.abuse_detected) {
-            flags.abuse_detected = 1;
+            flags.abuse_detected = true;
             debugs(11, DBG_IMPORTANT, "http handleMoreRequestBodyAvailable: Likely proxy abuse detected '" << request->client_addr << "' -> '" << entry->url() << "'" );
 
             if (virginReply()->sline.status == HTTP_INVALID_HEADER) {
index 5b7f0a417241effb25964aa963e52e9bd8707910..c49398bb2c98d23314695dc4fe4b5017b336322b 100644 (file)
 #ifndef SQUID_HTTP_H
 #define SQUID_HTTP_H
 
-#include "StoreIOBuffer.h"
 #include "comm.h"
-#include "comm/forward.h"
-#include "forward.h"
+#include "HttpStateFlags.h"
 #include "Server.h"
-#include "ChunkedCodingParser.h"
+
+class ChunkedCodingParser;
+class FwdState;
+class HttpHeader;
 
 class HttpStateData : public ServerStateData
 {
@@ -50,7 +51,7 @@ public:
                                        StoreEntry * entry,
                                        const AccessLogEntryPointer &al,
                                        HttpHeader * hdr_out,
-                                       const http_state_flags flags);
+                                       const HttpStateFlags &flags);
 
     virtual const Comm::ConnectionPointer & dataConnection() const;
     /* should be private */
@@ -61,10 +62,10 @@ public:
     virtual void maybeReadVirginBody(); // read response data from the network
     int cacheableReply();
 
-    peer *_peer;               /* peer request made to */
+    CachePeer *_peer;          /* CachePeer request made to */
     int eof;                   /* reached end-of-object? */
     int lastChunk;             /* reached last chunk of a chunk-encoded reply */
-    http_state_flags flags;
+    HttpStateFlags flags;
     size_t read_sz;
     int header_bytes_read;     // to find end of response,
     int64_t reply_bytes_read;  // without relying on StoreEntry
@@ -133,8 +134,8 @@ private:
     CBDATA_CLASS2(HttpStateData);
 };
 
-extern int httpCachable(const HttpRequestMethod&);
-extern void httpStart(FwdState *);
-extern const char *httpMakeVaryMark(HttpRequest * request, HttpReply const * reply);
+int httpCachable(const HttpRequestMethod&);
+void httpStart(FwdState *);
+const char *httpMakeVaryMark(HttpRequest * request, HttpReply const * reply);
 
 #endif /* SQUID_HTTP_H */
index c95eb24c66a8ff8cdd391f8d19e206925131320d..10b4a819260d20df85e5098cd1879573c4a5903f 100644 (file)
@@ -66,7 +66,7 @@ struct icmpEchoData {
     char payload[MAX_PAYLOAD];
 };
 
-SQUIDCEXTERN int icmp_pkts_sent;
+extern int icmp_pkts_sent;
 
 #endif /* USE_ICMP */
 
index 867547bac3239ae53ee5a3e22b7e364c2ae852b0..4d5490be4f64bdc6fc509e48ee6c51723d162c02 100644 (file)
@@ -37,6 +37,7 @@
 #include "icmp/IcmpSquid.h"
 #include "icmp/net_db.h"
 #include "ip/tools.h"
+#include "SquidConfig.h"
 #include "SquidIpc.h"
 #include "SquidTime.h"
 
index 5cde2d00dc08615b66017f1dfbe4f72b1eb3c4b2..195c888101c5d8f8960222df7e75cfb1b73887e3 100644 (file)
@@ -39,6 +39,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "cbdata.h"
 #include "disk.h"
 #include "event.h"
@@ -81,7 +82,7 @@ typedef enum {
 } netdb_conn_state_t;
 
 typedef struct {
-    peer *p;
+    CachePeer *p;
     StoreEntry *e;
     store_client *sc;
     HttpRequest *r;
@@ -105,7 +106,7 @@ static void netdbHostDelete(const net_db_name * x);
 static void netdbPurgeLRU(void);
 static netdbEntry *netdbLookupHost(const char *key);
 static net_db_peer *netdbPeerByName(const netdbEntry * n, const char *);
-static net_db_peer *netdbPeerAdd(netdbEntry * n, peer * e);
+static net_db_peer *netdbPeerAdd(netdbEntry * n, CachePeer * e);
 static const char *netdbPeerName(const char *name);
 static IPH netdbSendPing;
 static QS sortPeerByRtt;
@@ -116,7 +117,7 @@ static FREE netdbFreeNetdbEntry;
 static STCB netdbExchangeHandleReply;
 static void netdbExchangeDone(void *);
 
-/* We have to keep a local list of peer names.  The Peers structure
+/* We have to keep a local list of CachePeer names.  The Peers structure
  * gets freed during a reconfigure.  We want this database to
  * remain persisitent, so _net_db_peer->peername points into this
  * linked list */
@@ -421,7 +422,7 @@ netdbPeerByName(const netdbEntry * n, const char *peername)
 }
 
 static net_db_peer *
-netdbPeerAdd(netdbEntry * n, peer * e)
+netdbPeerAdd(netdbEntry * n, CachePeer * e)
 {
     net_db_peer *p;
     net_db_peer *o;
@@ -1123,7 +1124,7 @@ netdbHostData(const char *host, int *samp, int *rtt, int *hops)
 }
 
 void
-netdbUpdatePeer(HttpRequest * r, peer * e, int irtt, int ihops)
+netdbUpdatePeer(HttpRequest * r, CachePeer * e, int irtt, int ihops)
 {
 #if USE_ICMP
     netdbEntry *n;
@@ -1159,7 +1160,7 @@ netdbUpdatePeer(HttpRequest * r, peer * e, int irtt, int ihops)
 }
 
 void
-netdbExchangeUpdatePeer(Ip::Address &addr, peer * e, double rtt, double hops)
+netdbExchangeUpdatePeer(Ip::Address &addr, CachePeer * e, double rtt, double hops)
 {
 #if USE_ICMP
     netdbEntry *n;
@@ -1313,7 +1314,7 @@ void
 netdbExchangeStart(void *data)
 {
 #if USE_ICMP
-    peer *p = (peer *)data;
+    CachePeer *p = (CachePeer *)data;
     char *uri;
     netdbExchangeState *ex;
     StoreIOBuffer tempBuffer;
@@ -1334,7 +1335,7 @@ netdbExchangeStart(void *data)
     assert(NULL != ex->r);
     ex->r->http_ver = HttpVersion(1,1);
     ex->connstate = STATE_HEADER;
-    ex->e = storeCreateEntry(uri, uri, request_flags(), METHOD_GET);
+    ex->e = storeCreateEntry(uri, uri, RequestFlags(), METHOD_GET);
     ex->buf_sz = NETDB_REQBUF_SZ;
     assert(NULL != ex->e);
     ex->sc = storeClientListAdd(ex->e, ex);
@@ -1343,7 +1344,7 @@ netdbExchangeStart(void *data)
     tempBuffer.data = ex->buf;
     storeClientCopy(ex->sc, ex->e, tempBuffer,
                     netdbExchangeHandleReply, ex);
-    ex->r->flags.loopdetect = 1;       /* cheat! -- force direct */
+    ex->r->flags.loopDetected = 1;     /* cheat! -- force direct */
 
     if (p->login)
         xstrncpy(ex->r->login, p->login, MAX_LOGIN_SZ);
@@ -1355,11 +1356,11 @@ netdbExchangeStart(void *data)
 #endif
 }
 
-peer *
+CachePeer *
 netdbClosestParent(HttpRequest * request)
 {
 #if USE_ICMP
-    peer *p = NULL;
+    CachePeer *p = NULL;
     netdbEntry *n;
     const ipcache_addrs *ia;
     net_db_peer *h;
index 8282ad4d4f9e48360627f1c228a07fe8211da85b..87bdaaca5331d84818899b857f7df72699f81dfa 100644 (file)
@@ -1,34 +1,72 @@
 #ifndef ICMP_NET_DB_H
 #define ICMP_NET_DB_H
 
+#include "hash.h"
+
+class CachePeer;
+class HttpRequest;
+class netdbEntry;
+class StoreEntry;
 namespace Ip
 {
 class Address;
 };
 
-class StoreEntry;
-class HttpRequest;
+// POD
+class net_db_name
+{
+public:
+    hash_link hash;     /* must be first */
+    net_db_name *next;
+    netdbEntry *net_db_entry;
+};
+
+// POD
+class net_db_peer
+{
+public:
+    const char *peername;
+    double hops;
+    double rtt;
+    time_t expires;
+};
 
-/* for struct peer */
-#include "structs.h"
+// POD
+class netdbEntry
+{
+public:
+    hash_link hash;     /* must be first */
+    char network[MAX_IPSTRLEN];
+    int pings_sent;
+    int pings_recv;
+    double hops;
+    double rtt;
+    time_t next_ping_time;
+    time_t last_use_time;
+    int link_count;
+    net_db_name *hosts;
+    net_db_peer *peers;
+    int n_peers_alloc;
+    int n_peers;
+};
 
-SQUIDCEXTERN void netdbInit(void);
+void netdbInit(void);
 
-SQUIDCEXTERN void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
-SQUIDCEXTERN void netdbPingSite(const char *hostname);
+void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
+void netdbPingSite(const char *hostname);
 void netdbDump(StoreEntry *);
 
-SQUIDCEXTERN void netdbFreeMemory(void);
-SQUIDCEXTERN int netdbHostHops(const char *host);
-SQUIDCEXTERN int netdbHostRtt(const char *host);
-SQUIDCEXTERN void netdbUpdatePeer(HttpRequest *, peer * e, int rtt, int hops);
+void netdbFreeMemory(void);
+int netdbHostHops(const char *host);
+int netdbHostRtt(const char *host);
+void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops);
 
-SQUIDCEXTERN void netdbDeleteAddrNetwork(Ip::Address &addr);
-SQUIDCEXTERN void netdbBinaryExchange(StoreEntry *);
-SQUIDCEXTERN void netdbExchangeStart(void *);
+void netdbDeleteAddrNetwork(Ip::Address &addr);
+void netdbBinaryExchange(StoreEntry *);
+void netdbExchangeStart(void *);
 
-SQUIDCEXTERN void netdbExchangeUpdatePeer(Ip::Address &, peer *, double, double);
-SQUIDCEXTERN peer *netdbClosestParent(HttpRequest *);
-SQUIDCEXTERN void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
+void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double);
+CachePeer *netdbClosestParent(HttpRequest *);
+void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
 
 #endif /* ICMP_NET_DB_H */
index b55f0671d597e668fe11b85a89c11b568b11bfd2..6b253bcd5f01e0a39c3e86e332646b8f7b34b538 100644 (file)
@@ -56,6 +56,7 @@
 #include "neighbors.h"
 #include "refresh.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "Store.h"
index e3baaa3e6a9cac63ef7b020721614d280ffc41af..ec82fe95bcbc794d2c654f9018c004f77f61f204 100644 (file)
--- a/src/int.h
+++ b/src/int.h
@@ -32,6 +32,6 @@
  *
  */
 
-extern int isPowTen(int); //int.cc
+int isPowTen(int); //int.cc
 
 #endif /* SQUID_INT_H_ */
index e25a82a27b6d591ae6c5ec12007cec6115513a1a..15ef9905e756ff830a19e6a98892616dd8cb8218 100644 (file)
@@ -40,6 +40,7 @@
 #include "HttpRequest.h"
 #include "HttpReply.h"
 #include "MemBuf.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "tools.h"
 #include "URL.h"
index d24ead27282a0616b9c75bd28b1fefb69008414c..6c4eac5643ca77d3bbd6cc21d39c5fa2c76af09a 100644 (file)
 class HttpRequest;
 class StoreEntry;
 
-extern void internalStart(const Comm::ConnectionPointer &clientConn, HttpRequest *, StoreEntry *);
-extern int internalCheck(const char *urlpath);
-extern int internalStaticCheck(const char *urlpath);
-extern char *internalLocalUri(const char *dir, const char *name);
-extern char *internalRemoteUri(const char *, unsigned short, const char *, const char *);
-extern const char *internalHostname(void);
-extern int internalHostnameIs(const char *);
+void internalStart(const Comm::ConnectionPointer &clientConn, HttpRequest *, StoreEntry *);
+int internalCheck(const char *urlpath);
+int internalStaticCheck(const char *urlpath);
+char *internalLocalUri(const char *dir, const char *name);
+char *internalRemoteUri(const char *, unsigned short, const char *, const char *);
+const char *internalHostname(void);
+int internalHostnameIs(const char *);
 
 #endif /* SQUID_INTERNAL_H_ */
index 3a3589d486db52b992ddf69cc481e054e9f229b6..2e277ef4902fdc9cce1d0bd090e8191bc881f52a 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "hier_code.h"
 #include "ip/forward.h"
+#include "structs.h"
 
 #if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_H
 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
 #include <limits>
 #endif
 
-// Forward-declaration
+class ACLList;
 class fde;
 
+// TODO: move to new ACL framework
+// POD
+class acl_tos {
+public:
+    acl_tos *next;
+    ACLList *aclList;
+    tos_t tos;
+};
+// TODO: move to new ACL framework
+// POD
+class acl_nfmark {
+public:
+    acl_nfmark *next;
+    ACLList *aclList;
+    nfmark_t nfmark;
+};
+
+
 namespace Ip
 {
 
index 5a95b131284a90509b7d1564f5ad40dbaa350e2f..e39e01ba595fe7cd59cfd8d9248b0e9d8e18adf9 100644 (file)
@@ -36,6 +36,7 @@
 #include "fde.h"
 #include "globals.h"
 #include "ip/Address.h"
+#include "SquidConfig.h"
 #include "SquidIpc.h"
 #include "tools.h"
 #include "rfc1738.h"
index f4a5f11d100d270e4a3e8d13bcc022704d9d49d5..d73ea0e667d9dfaa21d67e6c5293232cb0c5eeb8 100644 (file)
@@ -7,8 +7,10 @@
 #define SQUID_IPC_FORWARDER_H
 
 #include "base/AsyncJob.h"
-#include "mgr/ActionParams.h"
+#include "cbdata.h"
 #include "ipc/Request.h"
+#include "mgr/ActionParams.h"
+
 #include <map>
 
 namespace Ipc
index a05140ab73be4b257134a338a5bd4e0bcb68cc3b..a5dfddfba34b90a771db38b0c4523b6cdd155a38 100644 (file)
@@ -7,7 +7,7 @@
 #include "globals.h"
 #include "ipc/Kids.h"
 #include "tools.h"
-#include "structs.h"
+#include "SquidConfig.h"
 
 Kids TheKids;
 KidName TheKidName;
index cd63778e1508c7745f5d098c574ac78daba1700a..779db4fe96b86bfc3cb70bf5923d0b0338a19c4f 100644 (file)
@@ -8,7 +8,6 @@
 #include "base/RunnersRegistry.h"
 #include "ipc/mem/PagePool.h"
 #include "ipc/mem/Pages.h"
-#include "structs.h"
 #include "SwapDir.h"
 #include "tools.h"
 
index 46ca0220c7c846d4963601a2c3dda75a2b04b31c..bb97d1a1b95cdb6b170bec3aa497bb2d6ce6a118 100644 (file)
@@ -38,6 +38,7 @@
 #include "fde.h"
 #include "ip/Address.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidIpc.h"
 #include "SquidTime.h"
 #include "tools.h"
index 57e5f4fd632fef095d8122ee87baa16db3090b6b..08768200eea0430c515fa451647cbcc381b057fd 100644 (file)
@@ -41,6 +41,7 @@
 #include "Mem.h"
 #include "mgr/Registration.h"
 #include "rfc3596.h"
+#include "SquidConfig.h"
 #include "SquidDns.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
index 6395d3160e44875312179691a6aa09a8cda28a4c..aa56c8149a07816564de3c78d0dc84edb5d68ffe 100644 (file)
@@ -18,19 +18,19 @@ typedef struct _ipcache_addrs {
 
 typedef void IPH(const ipcache_addrs *, const DnsLookupDetails &details, void *);
 
-extern void ipcache_purgelru(void *);
-extern void ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData);
-extern const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
-extern void ipcacheInvalidate(const char *);
-extern void ipcacheInvalidateNegative(const char *);
-extern void ipcache_init(void);
-extern void ipcacheCycleAddr(const char *name, ipcache_addrs *);
-extern void ipcacheMarkBadAddr(const char *name, const Ip::Address &);
-extern void ipcacheMarkGoodAddr(const char *name, const Ip::Address &);
-extern void ipcacheMarkAllGood(const char *name);
-extern void ipcacheFreeMemory(void);
-extern ipcache_addrs *ipcacheCheckNumeric(const char *name);
-extern void ipcache_restart(void);
-extern int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr);
+void ipcache_purgelru(void *);
+void ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData);
+const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
+void ipcacheInvalidate(const char *);
+void ipcacheInvalidateNegative(const char *);
+void ipcache_init(void);
+void ipcacheCycleAddr(const char *name, ipcache_addrs *);
+void ipcacheMarkBadAddr(const char *name, const Ip::Address &);
+void ipcacheMarkGoodAddr(const char *name, const Ip::Address &);
+void ipcacheMarkAllGood(const char *name);
+void ipcacheFreeMemory(void);
+ipcache_addrs *ipcacheCheckNumeric(const char *name);
+void ipcache_restart(void);
+int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr);
 
 #endif /* _SQUID_IPCACHE_H */
diff --git a/src/log/CustomLog.cc b/src/log/CustomLog.cc
new file mode 100644 (file)
index 0000000..22be682
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ *
+ */
+#include "squid.h"
+#include "CustomLog.h"
+
diff --git a/src/log/CustomLog.h b/src/log/CustomLog.h
new file mode 100644 (file)
index 0000000..e995bc5
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef SQUID_CUSTOMLOG_H_
+#define SQUID_CUSTOMLOG_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.
+ *
+ */
+//#include "format/Format.h"
+#include "log/Formats.h"
+
+class ACLList;
+class Logfile;
+namespace Format {
+class Format;
+}
+
+/// representaiton of a custom log directive. Currently a POD.
+class CustomLog
+{
+public:
+    char *filename;
+    ACLList *aclList;
+    Format::Format *logFormat;
+    Logfile *logfile;
+    CustomLog *next;
+    Log::Format::log_type type;
+};
+
+#endif /* SQUID_CUSTOMLOG_H_ */
index 290a1e73c80aee72a146d86a0a5a7d39893d1f3b..088a4bbcb5685b23be237c2bf2db3b42de837fd6 100644 (file)
@@ -38,6 +38,7 @@
 #include "HttpRequest.h"
 #include "log/File.h"
 #include "log/Formats.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 void
index 6edd8edd7155961754d244dead56d8b2ddf5e6d2..f9270d6980a052cd0e4c24e8f456ad5149f2a915 100644 (file)
@@ -37,6 +37,7 @@
 #include "globals.h"
 #include "log/File.h"
 #include "log/Formats.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 void
index 7fb2a45970ab3518d483fe8d5cd85ce2faff215b..73e1d5496395d9804984f0aded69e312fb7af4df 100644 (file)
 
 #include "squid.h"
 #include "AccessLogEntry.h"
+#include "format/Format.h"
+#include "log/CustomLog.h"
 #include "log/File.h"
 #include "log/Formats.h"
 #include "MemBuf.h"
 
 void
-Log::Format::SquidCustom(const AccessLogEntry::Pointer &al, customlog * log)
+Log::Format::SquidCustom(const AccessLogEntry::Pointer &al, CustomLog * log)
 {
     static MemBuf mb;
     mb.reset();
index 016f0c0f34f1d5c082d5618b2133b45da5c9090f..928dae31e1b67748243d814f554193815cc65242 100644 (file)
@@ -40,6 +40,7 @@
 #include "HttpRequest.h"
 #include "log/File.h"
 #include "log/Formats.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 void
index ffe7d324a6bcc39723ac9cca48da3379dd463a0f..b90153338a574142c5f311acb90ac2d6a67b5322 100644 (file)
@@ -37,6 +37,7 @@
 #include "globals.h"
 #include "log/File.h"
 #include "log/Formats.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 void
index 8d60a086222fbe290f620142e9d4b2af5fac2f25..0e2dd16eca3d9faa24449518edde42f7cb4a6c66 100644 (file)
@@ -1,10 +1,12 @@
 #ifndef _SQUID_LOG_FORMATS_H
 #define _SQUID_LOG_FORMATS_H
 
+#include "AccessLogEntry.h"
 #include "RefCount.h"
 
 typedef RefCount<AccessLogEntry> AccessLogEntryPointer;
 class AccessLogEntry;
+class CustomLog;
 class Logfile;
 
 namespace Log
@@ -40,7 +42,7 @@ void SquidUserAgent(const AccessLogEntryPointer &al, Logfile * logfile);
 void SquidReferer(const AccessLogEntryPointer &al, Logfile * logfile);
 
 /// Log with a local custom format
-void SquidCustom(const AccessLogEntryPointer &al, customlog * log);
+void SquidCustom(const AccessLogEntryPointer &al, CustomLog * log);
 
 /// Log with Apache httpd common format
 void HttpdCommon(const AccessLogEntryPointer &al, Logfile * logfile);
index 5018962d7484c445e993645244e9b502be4dd87f..93c49d009c690711f90deffa9e47f778b2493d67 100644 (file)
@@ -27,5 +27,7 @@ liblog_la_SOURCES = \
        ModTcp.cc \
        ModTcp.h \
        ModUdp.cc \
-       ModUdp.h
+       ModUdp.h \
+       CustomLog.h \
+       CustomLog.cc
 
index 567e431d0d284a6a006bb1a5ede5256d6c9f9bf1..b89f46b47d1120f26c3852b9afbd418a7bd896b1 100644 (file)
@@ -39,6 +39,7 @@
 #include "log/File.h"
 #include "log/ModDaemon.h"
 #include "SquidIpc.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 #if HAVE_ERRNO_H
index d4669f44b3de5b7948159645eb2ab5adff8a309d..32b4832f7fedee0244d06f25586fa49251e77a3a 100644 (file)
@@ -37,6 +37,7 @@
 #include "globals.h"
 #include "log/File.h"
 #include "log/ModStdio.h"
+#include "SquidConfig.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>
index db8a9692afc8a275e035e853aaeb3a953c5da254..5d44b1286879320e6852857beee8cfcf8b3ba096 100644 (file)
@@ -39,7 +39,7 @@
 #include "log/File.h"
 #include "log/ModTcp.h"
 #include "Parsing.h"
-#include "structs.h"
+#include "SquidConfig.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>
index c6fd8c92ba92379de3168192cd32727f225ab4c7..cda9e68f3a67a9ba0a31958af15e6e034cea936b 100644 (file)
@@ -38,7 +38,7 @@
 #include "log/File.h"
 #include "log/ModUdp.h"
 #include "Parsing.h"
-#include "structs.h"
+#include "SquidConfig.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>
index 1a361d81f2c88b7fa6b86de31baecc4d8e21ad82..84d7c06d87a834e14ada1882dfe5fdb3fa19fa59 100644 (file)
 
 #include "squid.h"
 #include "AccessLogEntry.h"
-#include "Store.h"
-#include "errorpage.h"
-#include "err_detail_type.h"
 #include "acl/Checklist.h"
+#include "CachePeer.h"
+#include "err_detail_type.h"
+#include "errorpage.h"
 #include "errorpage.h"
 #include "format/Token.h"
 #include "globals.h"
 #include "HttpRequest.h"
 #include "log/access_log.h"
 #include "log/Config.h"
+#include "log/CustomLog.h"
 #include "log/File.h"
 #include "log/Formats.h"
 #include "MemBuf.h"
 #include "mgr/Registration.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
+#include "Store.h"
 
 #if USE_SQUID_EUI
 #include "eui/Eui48.h"
@@ -88,7 +91,7 @@ static void fvdbRegisterWithCacheManager();
 int LogfileStatus = LOG_DISABLE;
 
 void
-accessLogLogTo(customlog* log, AccessLogEntry::Pointer &al, ACLChecklist * checklist)
+accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist * checklist)
 {
 
     if (al->url == NULL)
@@ -201,7 +204,7 @@ accessLogLog(AccessLogEntry::Pointer &al, ACLChecklist * checklist)
 void
 accessLogRotate(void)
 {
-    customlog *log;
+    CustomLog *log;
 #if USE_FORW_VIA_DB
 
     fvdbClear();
@@ -223,7 +226,7 @@ accessLogRotate(void)
 void
 accessLogClose(void)
 {
-    customlog *log;
+    CustomLog *log;
 
     for (log = Config.Log.accesslogs; log; log = log->next) {
         if (log->logfile) {
@@ -298,7 +301,7 @@ accessLogRegisterWithCacheManager(void)
 void
 accessLogInit(void)
 {
-    customlog *log;
+    CustomLog *log;
 
     accessLogRegisterWithCacheManager();
 
index f07205049b6c71aca1108f86341271b809a5685f..c529051a84e17a1eb3a84f2497b046a1e4b3b5f5 100644 (file)
@@ -83,6 +83,7 @@
 #include "send-announce.h"
 #include "store_log.h"
 #include "tools.h"
+#include "SquidConfig.h"
 #include "SquidDns.h"
 #include "SquidTime.h"
 #include "stat.h"
index 761e5535998465aeca6f7e56342ce95dddb75a2d..56cad3e3d4955012888e24b9a64977870e1524f7 100644 (file)
  */
 
 #include "squid.h"
-#include "event.h"
+#include "acl/AclDenyInfoList.h"
+#include "acl/AclNameList.h"
+#include "CacheDigest.h"
 #include "ClientInfo.h"
-#include "Mem.h"
+#include "disk.h"
+#include "event.h"
 #include "md5.h"
+#include "Mem.h"
 #include "MemBuf.h"
 #include "memMeter.h"
 #include "mgr/Registration.h"
+#include "icmp/net_db.h"
+#include "RegexList.h"
+#include "SquidConfig.h"
 #include "SquidList.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StoreEntryStream.h"
+#include "structs.h"
 
 #if HAVE_IOMANIP
 #include <iomanip>
@@ -448,9 +456,9 @@ Mem::Init(void)
     memDataInit(MEM_16K_BUF, "16K Buffer", 16384, 10, false);
     memDataInit(MEM_32K_BUF, "32K Buffer", 32768, 10, false);
     memDataInit(MEM_64K_BUF, "64K Buffer", 65536, 10, false);
-    memDataInit(MEM_ACL_DENY_INFO_LIST, "acl_deny_info_list",
-                sizeof(acl_deny_info_list), 0);
-    memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(acl_name_list), 0);
+    memDataInit(MEM_ACL_DENY_INFO_LIST, "AclDenyInfoList",
+                sizeof(AclDenyInfoList), 0);
+    memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(AclNameList), 0);
 #if USE_CACHE_DIGESTS
 
     memDataInit(MEM_CACHE_DIGEST, "CacheDigest", sizeof(CacheDigest), 0);
@@ -463,7 +471,7 @@ Mem::Init(void)
     memDataInit(MEM_HTTP_HDR_CONTENT_RANGE, "HttpHdrContRange", sizeof(HttpHdrContRange), 0);
     memDataInit(MEM_NETDBENTRY, "netdbEntry", sizeof(netdbEntry), 0);
     memDataInit(MEM_NET_DB_NAME, "net_db_name", sizeof(net_db_name), 0);
-    memDataInit(MEM_RELIST, "relist", sizeof(relist), 0);
+    memDataInit(MEM_RELIST, "RegexList", sizeof(RegexList), 0);
     memDataInit(MEM_CLIENT_INFO, "ClientInfo", sizeof(ClientInfo), 0);
     memDataInit(MEM_MD5_DIGEST, "MD5 digest", SQUID_MD5_DIGEST_LENGTH, 0);
     MemPools[MEM_MD5_DIGEST]->setChunkSize(512 * 1024);
index 095d134315211ce5777ed7bd94fd4976710b8363..75ab674e51a769fd0ce1518c4c4efd7bb17dff75 100644 (file)
@@ -9,6 +9,7 @@
 #include "HttpRequestMethod.h"
 #include "ipc/forward.h"
 #include "mgr/QueryParams.h"
+#include "RequestFlags.h"
 
 namespace Mgr
 {
@@ -26,7 +27,7 @@ public:
     /* details of the client HTTP request that caused the action */
     String httpUri; ///< HTTP request URI
     _method_t httpMethod; ///< HTTP request method
-    request_flags httpFlags; ///< HTTP request flags
+    RequestFlags httpFlags; ///< HTTP request flags
     String httpOrigin;       ///< HTTP Origin: header (if any)
 
     /* action parameters extracted from the client HTTP request */
diff --git a/src/mgr/ActionPasswordList.cc b/src/mgr/ActionPasswordList.cc
new file mode 100644 (file)
index 0000000..b480a4a
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ *
+ */
+
+#include "squid.h"
+#include "mgr/ActionPasswordList.h"
+
diff --git a/src/mgr/ActionPasswordList.h b/src/mgr/ActionPasswordList.h
new file mode 100644 (file)
index 0000000..36ee101
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef SQUID_MGR_CACHEMGRPASSWD_H_
+#define SQUID_MGR_CACHEMGRPASSWD_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.
+ *
+ */
+
+class wordlist;
+
+namespace Mgr {
+//TODO: refactor into a std::list
+/// list of cachemgr password authorization definitions. Currently a POD.
+class ActionPasswordList
+{
+public:
+    char *passwd;
+    wordlist *actions;
+    ActionPasswordList *next;
+};
+
+} //namespace Mgr
+
+#endif /* SQUID_MGR_CACHEMGRPASSWD_H_ */
index cae33cad914315c0d791c7ba3515c6bb60d373c5..578a6204f49d823ac31e7e1ec78a24255d5c0a18 100644 (file)
@@ -12,6 +12,7 @@
 #include "mgr/Registration.h"
 #include "protos.h"
 #include "Store.h"
+#include "SquidConfig.h"
 
 Mgr::IndexAction::Pointer
 Mgr::IndexAction::Create(const Command::Pointer &cmd)
index 82b673bc32adeec868999967065063381bf1de7b..06cfbbd2e3e011bc593fcae177193c76d5ef3833 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "squid.h"
 #include "base/TextException.h"
+#include "IoStats.h"
 #include "ipc/Messages.h"
 #include "ipc/TypedMsgHdr.h"
 #include "mgr/IoAction.h"
@@ -24,13 +25,13 @@ Mgr::IoActionData&
 Mgr::IoActionData::operator += (const IoActionData& stats)
 {
     http_reads += stats.http_reads;
-    for (int i = 0; i < _iostats::histSize; ++i)
+    for (int i = 0; i < IoStats::histSize; ++i)
         http_read_hist[i] += stats.http_read_hist[i];
     ftp_reads += stats.ftp_reads;
-    for (int i = 0; i < _iostats::histSize; ++i)
+    for (int i = 0; i < IoStats::histSize; ++i)
         ftp_read_hist[i] += stats.ftp_read_hist[i];
     gopher_reads += stats.gopher_reads;
-    for (int i = 0; i < _iostats::histSize; ++i)
+    for (int i = 0; i < IoStats::histSize; ++i)
         gopher_read_hist[i] += stats.gopher_read_hist[i];
 
     return *this;
index ff0c998257fdef7020dcdbed90d6830fdc750766..6487247c1fbc59aa6a785abaea8a9014716c41d4 100644 (file)
@@ -7,7 +7,7 @@
 #define SQUID_MGR_IO_ACTION_H
 
 #include "mgr/Action.h"
-#include "structs.h" /* _iostats::histSize */
+#include "IoStats.h"
 
 namespace Mgr
 {
@@ -23,9 +23,9 @@ public:
     double http_reads;
     double ftp_reads;
     double gopher_reads;
-    double http_read_hist[_iostats::histSize];
-    double ftp_read_hist[_iostats::histSize];
-    double gopher_read_hist[_iostats::histSize];
+    double http_read_hist[IoStats::histSize];
+    double ftp_read_hist[IoStats::histSize];
+    double gopher_read_hist[IoStats::histSize];
 };
 
 /// implement aggregated 'io' action
index 690ba6089ebcd2fed87a1e20e3c7a5b192e996f8..118dfe5a0c7ef022bf8b987ddbad305bfcb3051c 100644 (file)
@@ -9,6 +9,8 @@ libmgr_la_SOURCES = \
        Action.h \
        ActionParams.cc \
        ActionParams.h \
+       ActionPasswordList.h \
+       ActionPasswordList.cc \
        ActionProfile.h \
        ActionWriter.cc \
        ActionWriter.h \
index da60fe056e98afc06ded9355e2a2d45026b04979..2d14023fd2d2caaf4e564fe2f83f6f7fc9d85444 100644 (file)
@@ -43,6 +43,8 @@
 #include "MemBuf.h"
 #include "mime.h"
 #include "MemObject.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "StoreClient.h"
 
@@ -430,7 +432,7 @@ MimeIcon::created (StoreEntry *newEntry)
 
     int n;
 
-    request_flags flags;
+    RequestFlags flags;
 
     struct stat sb;
 
index 621a2777da74c98d399c907816cf8d4764982f84..3d73ab4827046a3e1264fced1b36dcf40483be2a 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * DEBUG: section
- * AUTHOR:
+ * DEBUG: section 25    MIME Parsing and Internal Icons
+ * AUTHOR: Harvest Derived
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
 #ifndef SQUID_MIME_H_
 #define SQUID_MIME_H_
 
-extern void mimeInit(char *filename);
-extern char *mimeGetContentEncoding(const char *fn);
-extern char *mimeGetContentType(const char *fn);
-extern const char *mimeGetIconURL(const char *fn);
-extern char mimeGetTransferMode(const char *fn);
-extern int mimeGetDownloadOption(const char *fn);
-extern int mimeGetViewOption(const char *fn);
+void mimeInit(char *filename);
+char *mimeGetContentEncoding(const char *fn);
+char *mimeGetContentType(const char *fn);
+const char *mimeGetIconURL(const char *fn);
+char mimeGetTransferMode(const char *fn);
+int mimeGetDownloadOption(const char *fn);
+int mimeGetViewOption(const char *fn);
 
 #endif /* SQUID_MIME_H_ */
index 7a74d034a866ee83a0918c77bb732e7238529c41..cd67dfdb536e476270a615a596bf513315e3555c 100644 (file)
@@ -33,8 +33,8 @@
 #ifndef SQUID_MIME_HEADER_H_
 #define SQUID_MIME_HEADER_H_
 
-extern char *mime_get_header(const char *mime, const char *header);
-extern char *mime_get_header_field(const char *mime, const char *name, const char *prefix);
-extern size_t headersEnd(const char *, size_t);
+char *mime_get_header(const char *mime, const char *header);
+char *mime_get_header_field(const char *mime, const char *name, const char *prefix);
+size_t headersEnd(const char *, size_t);
 
 #endif /* SQUID_MIME_HEADER_H_ */
index 9af976ae1e1924037c2247e858f5ae22cd38c14d..dbc5194c764527d298158aa629284cf6a6501de2 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * DEBUG: section 07    Multicast
  * AUTHOR: Martin Hamilton
index 5a7e53261d86535b47859fde6682d2f08b26d27c..e2a585fb075c6278b3f3b9f6d5efd2f3abf43a4e 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * DEBUG: section
- * AUTHOR:
+ * DEBUG: section 07    Multicast
+ * AUTHOR: Martin Hamilton
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -35,7 +35,7 @@
 
 #include "ipcache.h"
 
-extern int mcastSetTtl(int, int);
+int mcastSetTtl(int, int);
 extern IPH mcastJoinGroups;
 
 #endif /* SQUID_MULTICAST_H_ */
index f96f93d3acd996726553fa9a6fd7e46d88360c93..73977af2f9aa77d637d512e45f3734c815512ca9 100644 (file)
@@ -34,6 +34,8 @@
 #include "acl/FilledChecklist.h"
 #include "anyp/PortCfg.h"
 #include "CacheDigest.h"
+#include "CachePeer.h"
+#include "CachePeerDomainList.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
 #include "event.h"
 #include "MemObject.h"
 #include "mgr/Registration.h"
 #include "multicast.h"
+#include "NeighborTypeDomainList.h"
 #include "neighbors.h"
 #include "PeerDigest.h"
 #include "PeerSelectState.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 #include "stat.h"
 /* count mcast group peers every 15 minutes */
 #define MCAST_COUNT_RATE 900
 
-bool peerAllowedToUse(const peer *, HttpRequest *);
-static int peerWouldBePinged(const peer *, HttpRequest *);
-static void neighborRemove(peer *);
-static void neighborAlive(peer *, const MemObject *, const icp_common_t *);
+bool peerAllowedToUse(const CachePeer *, HttpRequest *);
+static int peerWouldBePinged(const CachePeer *, HttpRequest *);
+static void neighborRemove(CachePeer *);
+static void neighborAlive(CachePeer *, const MemObject *, const icp_common_t *);
 #if USE_HTCP
-static void neighborAliveHtcp(peer *, const MemObject *, const htcpReplyData *);
+static void neighborAliveHtcp(CachePeer *, const MemObject *, const htcpReplyData *);
 #endif
-static void neighborCountIgnored(peer *);
+static void neighborCountIgnored(CachePeer *);
 static void peerRefreshDNS(void *);
 static IPH peerDNSConfigure;
-static bool peerProbeConnect(peer *);
+static bool peerProbeConnect(CachePeer *);
 static CNCB peerProbeConnectDone;
 static void peerCountMcastPeersDone(void *data);
 static void peerCountMcastPeersStart(void *data);
-static void peerCountMcastPeersSchedule(peer * p, time_t when);
+static void peerCountMcastPeersSchedule(CachePeer * p, time_t when);
 static IRCB peerCountHandleIcpReply;
 
 static void neighborIgnoreNonPeer(const Ip::Address &, icp_opcode);
 static OBJH neighborDumpPeers;
 static OBJH neighborDumpNonPeers;
-static void dump_peers(StoreEntry * sentry, peer * peers);
+static void dump_peers(StoreEntry * sentry, CachePeer * peers);
 
 static unsigned short echo_port;
 
 static int NLateReplies = 0;
-static peer *first_ping = NULL;
+static CachePeer *first_ping = NULL;
 
 const char *
-neighborTypeStr(const peer * p)
+neighborTypeStr(const CachePeer * p)
 {
     if (p->type == PEER_NONE)
         return "Non-Peer";
@@ -106,12 +111,12 @@ neighborTypeStr(const peer * p)
     return "Parent";
 }
 
-peer *
+CachePeer *
 whichPeer(const Ip::Address &from)
 {
     int j;
 
-    peer *p = NULL;
+    CachePeer *p = NULL;
     debugs(15, 3, "whichPeer: from " << from);
 
     for (p = Config.peers; p; p = p->next) {
@@ -126,10 +131,10 @@ whichPeer(const Ip::Address &from)
 }
 
 peer_t
-neighborType(const peer * p, const HttpRequest * request)
+neighborType(const CachePeer * p, const HttpRequest * request)
 {
 
-    const struct _domain_type *d = NULL;
+    const NeighborTypeDomainList *d = NULL;
 
     for (d = p->typelist; d; d = d->next) {
         if (0 == matchDomainName(request->GetHost(), d->domain))
@@ -149,33 +154,33 @@ neighborType(const peer * p, const HttpRequest * request)
  * \return Whether it is appropriate to fetch REQUEST from PEER.
  */
 bool
-peerAllowedToUse(const peer * p, HttpRequest * request)
+peerAllowedToUse(const CachePeer * p, HttpRequest * request)
 {
 
-    const struct _domain_ping *d = NULL;
+    const CachePeerDomainList *d = NULL;
     assert(request != NULL);
 
     if (neighborType(p, request) == PEER_SIBLING) {
 #if PEER_MULTICAST_SIBLINGS
         if (p->type == PEER_MULTICAST && p->options.mcast_siblings &&
-                (request->flags.nocache || request->flags.refresh || request->flags.loopdetect || request->flags.need_validation))
+                (request->flags.noCache || request->flags.refresh || request->flags.loopDetected || request->flags.needValidation))
             debugs(15, 2, "peerAllowedToUse(" << p->name << ", " << request->GetHost() << ") : multicast-siblings optimization match");
 #endif
-        if (request->flags.nocache)
+        if (request->flags.noCache)
             return false;
 
         if (request->flags.refresh)
             return false;
 
-        if (request->flags.loopdetect)
+        if (request->flags.loopDetected)
             return false;
 
-        if (request->flags.need_validation)
+        if (request->flags.needValidation)
             return false;
     }
 
     // CONNECT requests are proxy requests. Not to be forwarded to origin servers.
-    // Unless the destination port matches, in which case we MAY perform a 'DIRECT' to this peer.
+    // Unless the destination port matches, in which case we MAY perform a 'DIRECT' to this CachePeer.
     if (p->options.originserver && request->method == METHOD_CONNECT && request->port != p->in_addr.GetPort())
         return false;
 
@@ -205,9 +210,9 @@ peerAllowedToUse(const peer * p, HttpRequest * request)
     return (checklist.fastCheck() == ACCESS_ALLOWED);
 }
 
-/* Return TRUE if it is okay to send an ICP request to this peer.   */
+/* Return TRUE if it is okay to send an ICP request to this CachePeer.   */
 static int
-peerWouldBePinged(const peer * p, HttpRequest * request)
+peerWouldBePinged(const CachePeer * p, HttpRequest * request)
 {
     if (p->icp.port == 0)
         return 0;
@@ -243,9 +248,9 @@ peerWouldBePinged(const peer * p, HttpRequest * request)
     return 1;
 }
 
-/* Return TRUE if it is okay to send an HTTP request to this peer. */
+/* Return TRUE if it is okay to send an HTTP request to this CachePeer. */
 int
-peerHTTPOkay(const peer * p, HttpRequest * request)
+peerHTTPOkay(const CachePeer * p, HttpRequest * request)
 {
     if (p->max_conn)
         if (p->stats.conn_open >= p->max_conn)
@@ -263,7 +268,7 @@ peerHTTPOkay(const peer * p, HttpRequest * request)
 int
 neighborsCount(HttpRequest * request)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
     int count = 0;
 
     for (p = Config.peers; p; p = p->next)
@@ -275,10 +280,10 @@ neighborsCount(HttpRequest * request)
     return count;
 }
 
-peer *
+CachePeer *
 getFirstUpParent(HttpRequest * request)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
 
     for (p = Config.peers; p; p = p->next) {
         if (!neighborUp(p))
@@ -297,11 +302,11 @@ getFirstUpParent(HttpRequest * request)
     return p;
 }
 
-peer *
+CachePeer *
 getRoundRobinParent(HttpRequest * request)
 {
-    peer *p;
-    peer *q = NULL;
+    CachePeer *p;
+    CachePeer *q = NULL;
 
     for (p = Config.peers; p; p = p->next) {
         if (!p->options.roundrobin)
@@ -336,11 +341,11 @@ getRoundRobinParent(HttpRequest * request)
     return q;
 }
 
-peer *
+CachePeer *
 getWeightedRoundRobinParent(HttpRequest * request)
 {
-    peer *p;
-    peer *q = NULL;
+    CachePeer *p;
+    CachePeer *q = NULL;
     int weighted_rtt;
 
     for (p = Config.peers; p; p = p->next) {
@@ -403,7 +408,7 @@ peerClearRRLoop(void *data)
 }
 
 /**
- * This gets called on startup and restart to kick off the peer round-robin
+ * This gets called on startup and restart to kick off the CachePeer round-robin
  * maintenance event. It ensures that no matter how many times its called
  * no more than one event is scheduled.
  */
@@ -421,23 +426,23 @@ peerClearRRStart(void)
  * Called whenever the round-robin counters need to be reset to a sane state.
  * So far those times are:
  *  - On startup and reconfigure - to set the counters to sane initial settings.
- *  -  When a peer has revived from dead, to prevent the revived peer being
+ *  -  When a CachePeer has revived from dead, to prevent the revived CachePeer being
  *     flooded with requests which it has 'missed' during the down period.
  */
 void
 peerClearRR()
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
     for (p = Config.peers; p; p = p->next) {
         p->rr_count = 0;
     }
 }
 
 /**
- * Perform all actions when a peer is detected revived.
+ * Perform all actions when a CachePeer is detected revived.
  */
 void
-peerAlive(peer *p)
+peerAlive(CachePeer *p)
 {
     if (p->stats.logged_state == PEER_DEAD && p->tcp_up) {
         debugs(15, DBG_IMPORTANT, "Detected REVIVED " << neighborTypeStr(p) << ": " << p->name);
@@ -449,10 +454,10 @@ peerAlive(peer *p)
     p->stats.probe_start = 0;
 }
 
-peer *
+CachePeer *
 getDefaultParent(HttpRequest * request)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
 
     for (p = Config.peers; p; p = p->next) {
         if (neighborType(p, request) != PEER_PARENT)
@@ -473,23 +478,23 @@ getDefaultParent(HttpRequest * request)
     return NULL;
 }
 
-peer *
-getNextPeer(peer * p)
+CachePeer *
+getNextPeer(CachePeer * p)
 {
     return p->next;
 }
 
-peer *
+CachePeer *
 getFirstPeer(void)
 {
     return Config.peers;
 }
 
 static void
-neighborRemove(peer * target)
+neighborRemove(CachePeer * target)
 {
-    peer *p = NULL;
-    peer **P = NULL;
+    CachePeer *p = NULL;
+    CachePeer **P = NULL;
     p = Config.peers;
     P = &Config.peers;
 
@@ -530,8 +535,8 @@ neighbors_init(void)
 {
     struct servent *sep = NULL;
     const char *me = getMyHostname();
-    peer *thisPeer = NULL;
-    peer *next = NULL;
+    CachePeer *thisPeer = NULL;
+    CachePeer *next = NULL;
 
     neighborsRegisterWithCacheManager();
 
@@ -577,7 +582,7 @@ neighborsUdpPing(HttpRequest * request,
 {
     const char *url = entry->url();
     MemObject *mem = entry->mem_obj;
-    peer *p = NULL;
+    CachePeer *p = NULL;
     int i;
     int reqnum = 0;
     int flags;
@@ -608,7 +613,7 @@ neighborsUdpPing(HttpRequest * request,
         debugs(15, 5, "neighborsUdpPing: Peer " << p->host);
 
         if (!peerWouldBePinged(p, request))
-            continue;          /* next peer */
+            continue;          /* next CachePeer */
 
         ++peers_pinged;
 
@@ -687,8 +692,8 @@ neighborsUdpPing(HttpRequest * request,
         p->stats.last_query = squid_curtime;
 
         /*
-         * keep probe_start == 0 for a multicast peer,
-         * so neighborUp() never says this peer is dead.
+         * keep probe_start == 0 for a multicast CachePeer,
+         * so neighborUp() never says this CachePeer is dead.
          */
 
         if ((p->type != PEER_MULTICAST) && (p->stats.probe_start == 0))
@@ -730,9 +735,9 @@ neighborsUdpPing(HttpRequest * request,
     return peers_pinged;
 }
 
-/* lookup the digest of a given peer */
+/* lookup the digest of a given CachePeer */
 lookup_t
-peerDigestLookup(peer * p, HttpRequest * request)
+peerDigestLookup(CachePeer * p, HttpRequest * request)
 {
 #if USE_CACHE_DIGESTS
     const cache_key *key = request ? storeKeyPublicByRequest(request) : NULL;
@@ -772,17 +777,17 @@ peerDigestLookup(peer * p, HttpRequest * request)
     return LOOKUP_NONE;
 }
 
-/* select best peer based on cache digests */
-peer *
+/* select best CachePeer based on cache digests */
+CachePeer *
 neighborsDigestSelect(HttpRequest * request)
 {
-    peer *best_p = NULL;
+    CachePeer *best_p = NULL;
 #if USE_CACHE_DIGESTS
 
     int best_rtt = 0;
     int choice_count = 0;
     int ichoice_count = 0;
-    peer *p;
+    CachePeer *p;
     int p_rtt;
     int i;
 
@@ -814,7 +819,7 @@ neighborsDigestSelect(HttpRequest * request)
 
         debugs(15, 5, "neighborsDigestSelect: peer " << p->host << " rtt: " << p_rtt);
 
-        /* is this peer better than others in terms of rtt ? */
+        /* is this CachePeer better than others in terms of rtt ? */
         if (!best_p || (p_rtt && p_rtt < best_rtt)) {
             best_p = p;
             best_rtt = p_rtt;
@@ -837,7 +842,7 @@ neighborsDigestSelect(HttpRequest * request)
 }
 
 void
-peerNoteDigestLookup(HttpRequest * request, peer * p, lookup_t lookup)
+peerNoteDigestLookup(HttpRequest * request, CachePeer * p, lookup_t lookup)
 {
 #if USE_CACHE_DIGESTS
     if (p)
@@ -851,7 +856,7 @@ peerNoteDigestLookup(HttpRequest * request, peer * p, lookup_t lookup)
 }
 
 static void
-neighborAlive(peer * p, const MemObject * mem, const icp_common_t * header)
+neighborAlive(CachePeer * p, const MemObject * mem, const icp_common_t * header)
 {
     peerAlive(p);
     ++ p->stats.pings_acked;
@@ -863,7 +868,7 @@ neighborAlive(peer * p, const MemObject * mem, const icp_common_t * header)
 }
 
 static void
-neighborUpdateRtt(peer * p, MemObject * mem)
+neighborUpdateRtt(CachePeer * p, MemObject * mem)
 {
     int rtt, rtt_av_factor;
 
@@ -888,7 +893,7 @@ neighborUpdateRtt(peer * p, MemObject * mem)
 
 #if USE_HTCP
 static void
-neighborAliveHtcp(peer * p, const MemObject * mem, const htcpReplyData * htcp)
+neighborAliveHtcp(CachePeer * p, const MemObject * mem, const htcpReplyData * htcp)
 {
     peerAlive(p);
     ++ p->stats.pings_acked;
@@ -899,7 +904,7 @@ neighborAliveHtcp(peer * p, const MemObject * mem, const htcpReplyData * htcp)
 #endif
 
 static void
-neighborCountIgnored(peer * p)
+neighborCountIgnored(CachePeer * p)
 {
     if (p == NULL)
         return;
@@ -909,12 +914,12 @@ neighborCountIgnored(peer * p)
     ++NLateReplies;
 }
 
-static peer *non_peers = NULL;
+static CachePeer *non_peers = NULL;
 
 static void
 neighborIgnoreNonPeer(const Ip::Address &from, icp_opcode opcode)
 {
-    peer *np;
+    CachePeer *np;
 
     for (np = non_peers; np; np = np->next) {
         if (np->in_addr != from)
@@ -927,7 +932,7 @@ neighborIgnoreNonPeer(const Ip::Address &from, icp_opcode opcode)
     }
 
     if (np == NULL) {
-        np = (peer *)xcalloc(1, sizeof(peer));
+        np = (CachePeer *)xcalloc(1, sizeof(CachePeer));
         np->in_addr = from;
         np->icp.port = from.GetPort();
         np->type = PEER_NONE;
@@ -946,11 +951,11 @@ neighborIgnoreNonPeer(const Ip::Address &from, icp_opcode opcode)
 /* ignoreMulticastReply
  *
  * * We want to ignore replies from multicast peers if the
- * * cache_host_domain rules would normally prevent the peer
+ * * cache_host_domain rules would normally prevent the CachePeer
  * * from being used
  */
 static int
-ignoreMulticastReply(peer * p, MemObject * mem)
+ignoreMulticastReply(CachePeer * p, MemObject * mem)
 {
     if (p == NULL)
         return 0;
@@ -974,7 +979,7 @@ ignoreMulticastReply(peer * p, MemObject * mem)
 void
 neighborsUdpAck(const cache_key * key, icp_common_t * header, const Ip::Address &from)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
     StoreEntry *entry;
     MemObject *mem = NULL;
     peer_t ntype = PEER_NONE;
@@ -1086,10 +1091,10 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const Ip::Address
     }
 }
 
-peer *
+CachePeer *
 peerFindByName(const char *name)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
 
     for (p = Config.peers; p; p = p->next) {
         if (!strcasecmp(name, p->name))
@@ -1099,10 +1104,10 @@ peerFindByName(const char *name)
     return p;
 }
 
-peer *
+CachePeer *
 peerFindByNameAndPort(const char *name, unsigned short port)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
 
     for (p = Config.peers; p; p = p->next) {
         if (strcasecmp(name, p->name))
@@ -1118,17 +1123,17 @@ peerFindByNameAndPort(const char *name, unsigned short port)
 }
 
 int
-neighborUp(const peer * p)
+neighborUp(const CachePeer * p)
 {
     if (!p->tcp_up) {
-        if (!peerProbeConnect((peer *) p)) {
+        if (!peerProbeConnect((CachePeer *) p)) {
             debugs(15, 8, "neighborUp: DOWN (probed): " << p->host << " (" << p->in_addr << ")");
             return 0;
         }
     }
 
     /*
-     * The peer can not be UP if we don't have any IP addresses
+     * The CachePeer can not be UP if we don't have any IP addresses
      * for it.
      */
     if (0 == p->n_addresses) {
@@ -1154,14 +1159,14 @@ neighborUp(const peer * p)
 void
 peerDestroy(void *data)
 {
-    peer *p = (peer *)data;
+    CachePeer *p = (CachePeer *)data;
 
     if (p == NULL)
         return;
 
-    struct _domain_ping *nl = NULL;
+    CachePeerDomainList *nl = NULL;
 
-    for (struct _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);
@@ -1177,7 +1182,7 @@ peerDestroy(void *data)
 }
 
 void
-peerNoteDigestGone(peer * p)
+peerNoteDigestGone(CachePeer * p)
 {
 #if USE_CACHE_DIGESTS
     cbdataReferenceDone(p->digest);
@@ -1187,7 +1192,7 @@ peerNoteDigestGone(peer * p)
 static void
 peerDNSConfigure(const ipcache_addrs *ia, const DnsLookupDetails &, void *data)
 {
-    peer *p = (peer *)data;
+    CachePeer *p = (CachePeer *)data;
 
     int j;
 
@@ -1236,7 +1241,7 @@ peerDNSConfigure(const ipcache_addrs *ia, const DnsLookupDetails &, void *data)
 static void
 peerRefreshDNS(void *data)
 {
-    peer *p = NULL;
+    CachePeer *p = NULL;
 
     if (eventFind(peerRefreshDNS, NULL))
         eventDelete(peerRefreshDNS, NULL);
@@ -1255,7 +1260,7 @@ peerRefreshDNS(void *data)
 }
 
 static void
-peerConnectFailedSilent(peer * p)
+peerConnectFailedSilent(CachePeer * p)
 {
     p->stats.last_connect_failure = squid_curtime;
 
@@ -1274,14 +1279,14 @@ peerConnectFailedSilent(peer * p)
 }
 
 void
-peerConnectFailed(peer *p)
+peerConnectFailed(CachePeer *p)
 {
     debugs(15, DBG_IMPORTANT, "TCP connection to " << p->host << "/" << p->http_port << " failed");
     peerConnectFailedSilent(p);
 }
 
 void
-peerConnectSucceded(peer * p)
+peerConnectSucceded(CachePeer * p)
 {
     if (!p->tcp_up) {
         debugs(15, 2, "TCP connection to " << p->host << "/" << p->http_port << " succeded");
@@ -1297,7 +1302,7 @@ peerConnectSucceded(peer * p)
 * peerProbeConnect will be called on dead peers by neighborUp
 */
 static bool
-peerProbeConnect(peer * p)
+peerProbeConnect(CachePeer * p)
 {
     time_t ctimeout = p->connect_timeout > 0 ? p->connect_timeout : Config.Timeout.peer_connect;
     bool ret = (squid_curtime - p->stats.last_connect_failure) > (ctimeout * 10);
@@ -1308,7 +1313,7 @@ peerProbeConnect(peer * p)
     if (squid_curtime - p->stats.last_connect_probe == 0)
         return ret;/* don't probe to often */
 
-    /* for each IP address of this peer. find one that we can connect to and probe it. */
+    /* for each IP address of this CachePeer. find one that we can connect to and probe it. */
     for (int i = 0; i < p->n_addresses; ++i) {
         Comm::ConnectionPointer conn = new Comm::Connection;
         conn->remote = p->addresses[i];
@@ -1331,7 +1336,7 @@ peerProbeConnect(peer * p)
 static void
 peerProbeConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int xerrno, void *data)
 {
-    peer *p = (peer*)data;
+    CachePeer *p = (CachePeer*)data;
 
     if (status == COMM_OK) {
         peerConnectSucceded(p);
@@ -1345,7 +1350,7 @@ peerProbeConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int
 }
 
 static void
-peerCountMcastPeersSchedule(peer * p, time_t when)
+peerCountMcastPeersSchedule(CachePeer * p, time_t when)
 {
     if (p->mcast.flags.count_event_pending)
         return;
@@ -1361,7 +1366,7 @@ peerCountMcastPeersSchedule(peer * p, time_t when)
 static void
 peerCountMcastPeersStart(void *data)
 {
-    peer *p = (peer *)data;
+    CachePeer *p = (CachePeer *)data;
     ps_state *psstate;
     StoreEntry *fake;
     MemObject *mem;
@@ -1373,7 +1378,7 @@ peerCountMcastPeersStart(void *data)
     snprintf(url, MAX_URL, "http://");
     p->in_addr.ToURL(url+7, MAX_URL -8 );
     strcat(url, "/");
-    fake = storeCreateEntry(url, url, request_flags(), METHOD_GET);
+    fake = storeCreateEntry(url, url, RequestFlags(), METHOD_GET);
     HttpRequest *req = HttpRequest::CreateFromUrl(url);
     psstate = new ps_state;
     psstate->request = HTTPMSGLOCK(req);
@@ -1407,7 +1412,7 @@ peerCountMcastPeersDone(void *data)
     StoreEntry *fake = psstate->entry;
 
     if (cbdataReferenceValid(psstate->callback_data)) {
-        peer *p = (peer *)psstate->callback_data;
+        CachePeer *p = (CachePeer *)psstate->callback_data;
         p->mcast.flags.counting = 0;
         p->mcast.avg_n_members = Math::doubleAverage(p->mcast.avg_n_members, (double) psstate->ping.n_recv, ++p->mcast.n_times_counted, 10);
         debugs(15, DBG_IMPORTANT, "Group " << p->host  << ": " << psstate->ping.n_recv  <<
@@ -1426,7 +1431,7 @@ peerCountMcastPeersDone(void *data)
 }
 
 static void
-peerCountHandleIcpReply(peer * p, peer_t type, AnyP::ProtocolType proto, void *hdrnotused, void *data)
+peerCountHandleIcpReply(CachePeer * p, peer_t type, AnyP::ProtocolType proto, void *hdrnotused, void *data)
 {
     int rtt_av_factor;
 
@@ -1459,7 +1464,7 @@ neighborDumpNonPeers(StoreEntry * sentry)
 }
 
 void
-dump_peer_options(StoreEntry * sentry, peer * p)
+dump_peer_options(StoreEntry * sentry, CachePeer * p)
 {
     if (p->options.proxy_only)
         storeAppendPrintf(sentry, " proxy-only");
@@ -1577,11 +1582,11 @@ dump_peer_options(StoreEntry * sentry, peer * p)
 }
 
 static void
-dump_peers(StoreEntry * sentry, peer * peers)
+dump_peers(StoreEntry * sentry, CachePeer * peers)
 {
-    peer *e = NULL;
+    CachePeer *e = NULL;
     char ntoabuf[MAX_IPSTRLEN];
-    struct _domain_ping *d = NULL;
+    CachePeerDomainList *d = NULL;
     icp_opcode op;
     int i;
 
@@ -1688,7 +1693,7 @@ neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const Ip::Addres
 {
     StoreEntry *e = Store::Root().get(key);
     MemObject *mem = NULL;
-    peer *p;
+    CachePeer *p;
     peer_t ntype = PEER_NONE;
     debugs(15, 6, "neighborsHtcpReply: " <<
            (htcp->hit ? "HIT" : "MISS") << " " <<
@@ -1753,7 +1758,7 @@ neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const Ip::Addres
 void
 neighborsHtcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, htcp_clr_reason reason)
 {
-    peer *p;
+    CachePeer *p;
     char buf[128];
 
     for (p = Config.peers; p; p = p->next) {
index f62195ad09e51d6ee2bbc49b09cab2ff79385ef8..a946c38409e134224596f2f828e835a679826db2 100644 (file)
 #define SQUID_NEIGHBORS_H_
 
 #include "enums.h"
-#include "HttpRequestMethod.h"
+#include "ICP.h"
 #include "lookup_t.h"
-#include "ip/Address.h"
-#include "typedefs.h"
 
 class HttpRequest;
-class peer;
+class HttpRequestMethod;
+class CachePeer;
 class StoreEntry;
 
-SQUIDCEXTERN peer *getFirstPeer(void);
-SQUIDCEXTERN peer *getFirstUpParent(HttpRequest *);
-SQUIDCEXTERN peer *getNextPeer(peer *);
-SQUIDCEXTERN peer *getSingleParent(HttpRequest *);
-SQUIDCEXTERN int neighborsCount(HttpRequest *);
-SQUIDCEXTERN int neighborsUdpPing(HttpRequest *,
-                                  StoreEntry *,
-                                  IRCB * callback,
-                                  void *data,
-                                  int *exprep,
-                                  int *timeout);
-SQUIDCEXTERN void neighborAddAcl(const char *, const char *);
+CachePeer *getFirstPeer(void);
+CachePeer *getFirstUpParent(HttpRequest *);
+CachePeer *getNextPeer(CachePeer *);
+CachePeer *getSingleParent(HttpRequest *);
+int neighborsCount(HttpRequest *);
+int neighborsUdpPing(HttpRequest *,
+                StoreEntry *,
+                IRCB * callback,
+                void *data,
+                int *exprep,
+                int *timeout);
+void neighborAddAcl(const char *, const char *);
 
-SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const Ip::Address &);
-SQUIDCEXTERN void neighborAdd(const char *, const char *, int, int, int, int, int);
-SQUIDCEXTERN void neighbors_init(void);
+void neighborsUdpAck(const cache_key *, icp_common_t *, const Ip::Address &);
+void neighborAdd(const char *, const char *, int, int, int, int, int);
+void neighbors_init(void);
 #if USE_HTCP
-SQUIDCEXTERN void neighborsHtcpClear(StoreEntry *, const char *, HttpRequest *, const HttpRequestMethod &, htcp_clr_reason);
+void neighborsHtcpClear(StoreEntry *, const char *, HttpRequest *, const HttpRequestMethod &, htcp_clr_reason);
 #endif
-SQUIDCEXTERN peer *peerFindByName(const char *);
-SQUIDCEXTERN peer *peerFindByNameAndPort(const char *, unsigned short);
-SQUIDCEXTERN peer *getDefaultParent(HttpRequest * request);
-SQUIDCEXTERN peer *getRoundRobinParent(HttpRequest * request);
-SQUIDCEXTERN peer *getWeightedRoundRobinParent(HttpRequest * request);
-SQUIDCEXTERN void peerClearRRStart(void);
-SQUIDCEXTERN void peerClearRR(void);
-SQUIDCEXTERN lookup_t peerDigestLookup(peer * p, HttpRequest * request);
-SQUIDCEXTERN peer *neighborsDigestSelect(HttpRequest * request);
-SQUIDCEXTERN void peerNoteDigestLookup(HttpRequest * request, peer * p, lookup_t lookup);
-SQUIDCEXTERN void peerNoteDigestGone(peer * p);
-SQUIDCEXTERN int neighborUp(const peer * e);
-SQUIDCEXTERN CBDUNL peerDestroy;
-SQUIDCEXTERN const char *neighborTypeStr(const peer * e);
-SQUIDCEXTERN peer_t neighborType(const peer *, const HttpRequest *);
-SQUIDCEXTERN void peerConnectFailed(peer *);
-SQUIDCEXTERN void peerConnectSucceded(peer *);
-SQUIDCEXTERN void dump_peer_options(StoreEntry *, peer *);
-SQUIDCEXTERN int peerHTTPOkay(const peer *, HttpRequest *);
+CachePeer *peerFindByName(const char *);
+CachePeer *peerFindByNameAndPort(const char *, unsigned short);
+CachePeer *getDefaultParent(HttpRequest * request);
+CachePeer *getRoundRobinParent(HttpRequest * request);
+CachePeer *getWeightedRoundRobinParent(HttpRequest * request);
+void peerClearRRStart(void);
+void peerClearRR(void);
+lookup_t peerDigestLookup(CachePeer * p, HttpRequest * request);
+CachePeer *neighborsDigestSelect(HttpRequest * request);
+void peerNoteDigestLookup(HttpRequest * request, CachePeer * p, lookup_t lookup);
+void peerNoteDigestGone(CachePeer * p);
+int neighborUp(const CachePeer * e);
+CBDUNL peerDestroy;
+const char *neighborTypeStr(const CachePeer * e);
+peer_t neighborType(const CachePeer *, const HttpRequest *);
+void peerConnectFailed(CachePeer *);
+void peerConnectSucceded(CachePeer *);
+void dump_peer_options(StoreEntry *, CachePeer *);
+int peerHTTPOkay(const CachePeer *, HttpRequest *);
 
-SQUIDCEXTERN peer *whichPeer(const Ip::Address &from);
+CachePeer *whichPeer(const Ip::Address &from);
 
 #endif /* SQUID_NEIGHBORS_H_ */
index c66b15626ebaad5fda8c665574cc84dae9ccf3a1..0375c7ebd67f1fed4b0880661832af34a09cf5dd 100644 (file)
@@ -38,6 +38,7 @@
 #include "globals.h"
 #include "mgr/Registration.h"
 #include "pconn.h"
+#include "SquidConfig.h"
 #include "Store.h"
 
 #define PCONN_FDS_SZ   8       /* pconn set size, increase for better memcache hit rate */
index 95368c4d34a3c497cadd370b04383bd444690082..e399c3c4d693ac519869804cd41840bfdcbbeaa2 100644 (file)
@@ -34,6 +34,7 @@
 #include "squid.h"
 #if USE_CACHE_DIGESTS
 #include "CacheDigest.h"
+#include "CachePeer.h"
 #include "event.h"
 #include "forward.h"
 #include "globals.h"
@@ -90,7 +91,7 @@ static time_t pd_last_req_time = 0;   /* last call to Check */
 
 /* initialize peer digest */
 static void
-peerDigestInit(PeerDigest * pd, peer * p)
+peerDigestInit(PeerDigest * pd, CachePeer * p)
 {
     assert(pd && p);
 
@@ -137,7 +138,7 @@ PeerDigest::operator delete (void *address)
 
 /* allocate new peer digest, call Init, and lock everything */
 PeerDigest *
-peerDigestCreate(peer * p)
+peerDigestCreate(CachePeer * p)
 {
     PeerDigest *pd;
     assert(p);
@@ -164,7 +165,7 @@ peerDigestDestroy(PeerDigest * pd)
      * tell it that the digest is gone.
      */
     if (cbdataReferenceValidDone(peerTmp, &p))
-        peerNoteDigestGone((peer *)p);
+        peerNoteDigestGone((CachePeer *)p);
 
     peerDigestClean(pd);
 
@@ -312,7 +313,7 @@ CBDATA_TYPE(DigestFetchState);
 static void
 peerDigestRequest(PeerDigest * pd)
 {
-    peer *p = pd->peer;
+    CachePeer *p = pd->peer;
     StoreEntry *e, *old_e;
     char *url;
     const cache_key *key;
index 94d3f4de394b6e66e7d9c1e8f0a4054f50f464d8..8b1c8e9254736ed8c33e4546d7e4bddb8d39121c 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "acl/FilledChecklist.h"
+#include "CachePeer.h"
 #include "carp.h"
 #include "client_side.h"
 #include "DnsLookupDetails.h"
@@ -50,6 +51,7 @@
 #include "peer_sourcehash.h"
 #include "peer_userhash.h"
 #include "PeerSelectState.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 
@@ -68,10 +70,10 @@ static void peerSelectFoo(ps_state *);
 static void peerPingTimeout(void *data);
 static IRCB peerHandlePingReply;
 static void peerSelectStateFree(ps_state * psstate);
-static void peerIcpParentMiss(peer *, icp_common_t *, ps_state *);
+static void peerIcpParentMiss(CachePeer *, icp_common_t *, ps_state *);
 #if USE_HTCP
-static void peerHtcpParentMiss(peer *, htcpReplyData *, ps_state *);
-static void peerHandleHtcpReply(peer *, peer_t, htcpReplyData *, void *);
+static void peerHtcpParentMiss(CachePeer *, htcpReplyData *, ps_state *);
+static void peerHandleHtcpReply(CachePeer *, peer_t, htcpReplyData *, void *);
 #endif
 static int peerCheckNetdbDirect(ps_state * psstate);
 static void peerGetSomeNeighbor(ps_state *);
@@ -79,7 +81,7 @@ static void peerGetSomeNeighborReplies(ps_state *);
 static void peerGetSomeDirect(ps_state *);
 static void peerGetSomeParent(ps_state *);
 static void peerGetAllParents(ps_state *);
-static void peerAddFwdServer(FwdServer **, peer *, hier_code);
+static void peerAddFwdServer(FwdServer **, CachePeer *, hier_code);
 static void peerSelectPinned(ps_state * ps);
 static void peerSelectDnsResults(const ipcache_addrs *ia, const DnsLookupDetails &details, void *data);
 
@@ -232,7 +234,7 @@ peerSelectDnsPaths(ps_state *psstate)
     // on intercepted traffic which failed Host verification
     const HttpRequest *req = psstate->request;
     const bool isIntercepted = !req->flags.redirected &&
-                               (req->flags.intercepted || req->flags.spoof_client_ip);
+                               (req->flags.intercepted || req->flags.spoofClientIp);
     const bool useOriginalDst = Config.onoff.client_dst_passthru || !req->flags.hostVerified;
     const bool choseDirect = fs && fs->code == HIER_DIRECT;
     if (isIntercepted && useOriginalDst && choseDirect) {
@@ -337,7 +339,7 @@ peerSelectDnsResults(const ipcache_addrs *ia, const DnsLookupDetails &details, v
                 break;
 
             // for TPROXY we must skip unusable addresses.
-            if (psstate->request->flags.spoof_client_ip && !(fs->_peer && fs->_peer->options.no_tproxy) ) {
+            if (psstate->request->flags.spoofClientIp && !(fs->_peer && fs->_peer->options.no_tproxy) ) {
                 if (ia->in_addrs[n].IsIPv4() != psstate->request->client_addr.IsIPv4()) {
                     // we CAN'T spoof the address on this link. find another.
                     continue;
@@ -380,7 +382,7 @@ static int
 peerCheckNetdbDirect(ps_state * psstate)
 {
 #if USE_ICMP
-    peer *p;
+    CachePeer *p;
     int myrtt;
     int myhops;
 
@@ -441,11 +443,11 @@ peerSelectFoo(ps_state * ps)
             ps->acl_checklist = new ACLFilledChecklist(Config.accessList.NeverDirect, request, NULL);
             ps->acl_checklist->nonBlockingCheck(peerCheckNeverDirectDone, ps);
             return;
-        } else if (request->flags.no_direct) {
+        } else if (request->flags.noDirect) {
             /** if we are accelerating, direct is not an option. */
             ps->direct = DIRECT_NO;
             debugs(44, 3, "peerSelectFoo: direct = " << DirectStr[ps->direct] << " (forced non-direct)");
-        } else if (request->flags.loopdetect) {
+        } else if (request->flags.loopDetected) {
             /** if we are in a forwarding-loop, direct is not an option. */
             ps->direct = DIRECT_YES;
             debugs(44, 3, "peerSelectFoo: direct = " << DirectStr[ps->direct] << " (forwarding loop detected)");
@@ -505,7 +507,7 @@ peerSelectFoo(ps_state * ps)
     peerSelectDnsPaths(ps);
 }
 
-bool peerAllowedToUse(const peer * p, HttpRequest * request);
+bool peerAllowedToUse(const CachePeer * p, HttpRequest * request);
 
 /**
  * peerSelectPinned
@@ -518,7 +520,7 @@ peerSelectPinned(ps_state * ps)
     HttpRequest *request = ps->request;
     if (!request->pinnedConnection())
         return;
-    peer *pear = request->pinnedConnection()->pinnedPeer();
+    CachePeer *pear = request->pinnedConnection()->pinnedPeer();
     if (Comm::IsConnOpen(request->pinnedConnection()->validatePinnedConnection(request, pear))) {
         if (pear && peerAllowedToUse(pear, request)) {
             peerAddFwdServer(&ps->servers, pear, PINNED);
@@ -547,7 +549,7 @@ peerGetSomeNeighbor(ps_state * ps)
 {
     StoreEntry *entry = ps->entry;
     HttpRequest *request = ps->request;
-    peer *p;
+    CachePeer *p;
     hier_code code = HIER_NONE;
     assert(entry->ping_status == PING_NONE);
 
@@ -611,7 +613,7 @@ static void
 peerGetSomeNeighborReplies(ps_state * ps)
 {
     HttpRequest *request = ps->request;
-    peer *p = NULL;
+    CachePeer *p = NULL;
     hier_code code = HIER_NONE;
     assert(ps->entry->ping_status == PING_WAITING);
     assert(ps->direct != DIRECT_YES);
@@ -662,7 +664,7 @@ peerGetSomeDirect(ps_state * ps)
 static void
 peerGetSomeParent(ps_state * ps)
 {
-    peer *p;
+    CachePeer *p;
     HttpRequest *request = ps->request;
     hier_code code = HIER_NONE;
     debugs(44, 3, "peerGetSomeParent: " << RequestMethodStr(request->method) << " " << request->GetHost());
@@ -699,7 +701,7 @@ peerGetSomeParent(ps_state * ps)
 static void
 peerGetAllParents(ps_state * ps)
 {
-    peer *p;
+    CachePeer *p;
     HttpRequest *request = ps->request;
     /* Add all alive parents */
 
@@ -759,7 +761,7 @@ peerSelectInit(void)
 }
 
 static void
-peerIcpParentMiss(peer * p, icp_common_t * header, ps_state * ps)
+peerIcpParentMiss(CachePeer * p, icp_common_t * header, ps_state * ps)
 {
     int rtt;
 
@@ -800,7 +802,7 @@ peerIcpParentMiss(peer * p, icp_common_t * header, ps_state * ps)
 }
 
 static void
-peerHandleIcpReply(peer * p, peer_t type, icp_common_t * header, void *data)
+peerHandleIcpReply(CachePeer * p, peer_t type, icp_common_t * header, void *data)
 {
     ps_state *psstate = (ps_state *)data;
     icp_opcode op = header->getOpCode();
@@ -834,7 +836,7 @@ peerHandleIcpReply(peer * p, peer_t type, icp_common_t * header, void *data)
 
 #if USE_HTCP
 static void
-peerHandleHtcpReply(peer * p, peer_t type, htcpReplyData * htcp, void *data)
+peerHandleHtcpReply(CachePeer * p, peer_t type, htcpReplyData * htcp, void *data)
 {
     ps_state *psstate = (ps_state *)data;
     debugs(44, 3, "peerHandleHtcpReply: " <<
@@ -859,7 +861,7 @@ peerHandleHtcpReply(peer * p, peer_t type, htcpReplyData * htcp, void *data)
 }
 
 static void
-peerHtcpParentMiss(peer * p, htcpReplyData * htcp, ps_state * ps)
+peerHtcpParentMiss(CachePeer * p, htcpReplyData * htcp, ps_state * ps)
 {
     int rtt;
 
@@ -900,7 +902,7 @@ peerHtcpParentMiss(peer * p, htcpReplyData * htcp, ps_state * ps)
 #endif
 
 static void
-peerHandlePingReply(peer * p, peer_t type, AnyP::ProtocolType proto, void *pingdata, void *data)
+peerHandlePingReply(CachePeer * p, peer_t type, AnyP::ProtocolType proto, void *pingdata, void *data)
 {
     if (proto == AnyP::PROTO_ICP)
         peerHandleIcpReply(p, type, (icp_common_t *)pingdata, data);
@@ -917,7 +919,7 @@ peerHandlePingReply(peer * p, peer_t type, AnyP::ProtocolType proto, void *pingd
 }
 
 static void
-peerAddFwdServer(FwdServer ** FSVR, peer * p, hier_code code)
+peerAddFwdServer(FwdServer ** FSVR, CachePeer * p, hier_code code)
 {
     FwdServer *fs = (FwdServer *)memAllocate(MEM_FWD_SERVER);
     debugs(44, 5, "peerAddFwdServer: adding " <<
index 55774aebe657849c5c617be4bafe7b6e2f65ca30..53b78611c4b21e89b523e5388c6dfeffde5b2d04 100644 (file)
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "HttpRequest.h"
 #include "mgr/Registration.h"
 #include "neighbors.h"
+#include "SquidConfig.h"
 #include "Store.h"
 
 #if HAVE_MATH_H
 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
 
 static int n_sourcehash_peers = 0;
-static peer **sourcehash_peers = NULL;
+static CachePeer **sourcehash_peers = NULL;
 static OBJH peerSourceHashCachemgr;
 static void peerSourceHashRegisterWithCacheManager(void);
 
 static int
 peerSortWeight(const void *a, const void *b)
 {
-    const peer *const *p1 = (const peer *const *)a;
-    const peer *const *p2 = (const peer *const *)b;
+    const CachePeer *const *p1 = (const CachePeer *const *)a;
+    const CachePeer *const *p2 = (const CachePeer *const *)b;
     return (*p1)->weight - (*p2)->weight;
 }
 
@@ -64,8 +66,8 @@ peerSourceHashInit(void)
     int K;
     int k;
     double P_last, X_last, Xn;
-    peer *p;
-    peer **P;
+    CachePeer *p;
+    CachePeer **P;
     char *t;
     /* Clean up */
 
@@ -96,7 +98,7 @@ peerSourceHashInit(void)
     if (n_sourcehash_peers == 0)
         return;
 
-    sourcehash_peers = (peer **)xcalloc(n_sourcehash_peers, sizeof(*sourcehash_peers));
+    sourcehash_peers = (CachePeer **)xcalloc(n_sourcehash_peers, sizeof(*sourcehash_peers));
 
     /* Build a list of the found peers and calculate hashes and load factors */
     for (P = sourcehash_peers, p = Config.peers; p; p = p->next) {
@@ -164,13 +166,13 @@ peerSourceHashRegisterWithCacheManager(void)
                         peerSourceHashCachemgr, 0, 1);
 }
 
-peer *
+CachePeer *
 peerSourceHashSelectParent(HttpRequest * request)
 {
     int k;
     const char *c;
-    peer *p = NULL;
-    peer *tp;
+    CachePeer *p = NULL;
+    CachePeer *tp;
     unsigned int user_hash = 0;
     unsigned int combined_hash;
     double score;
@@ -189,7 +191,7 @@ peerSourceHashSelectParent(HttpRequest * request)
     for (c = key; *c != 0; ++c)
         user_hash += ROTATE_LEFT(user_hash, 19) + *c;
 
-    /* select peer */
+    /* select CachePeer */
     for (k = 0; k < n_sourcehash_peers; ++k) {
         tp = sourcehash_peers[k];
         combined_hash = (user_hash ^ tp->sourcehash.hash);
@@ -214,7 +216,7 @@ peerSourceHashSelectParent(HttpRequest * request)
 static void
 peerSourceHashCachemgr(StoreEntry * sentry)
 {
-    peer *p;
+    CachePeer *p;
     int sumfetches = 0;
     storeAppendPrintf(sentry, "%24s %10s %10s %10s %10s\n",
                       "Hostname",
index 10685c3810e6677d50b405f9e7bb8d531e924a7f..9e4440d1dfc80c005c633376c5fb9557d60870cf 100644 (file)
 #ifndef SQUID_PEER_SOURCEHASH_H_
 #define SQUID_PEER_SOURCEHASH_H_
 
-class peer;
+class CachePeer;
 class HttpRequest;
 
-extern void peerSourceHashInit(void);
-extern peer * peerSourceHashSelectParent(HttpRequest * request);
+void peerSourceHashInit(void);
+CachePeer * peerSourceHashSelectParent(HttpRequest * request);
 
 #endif /* SQUID_PEER_SOURCEHASH_H_ */
index 2cd385f8e2fc207ac767e53a5f376953c1bced7f..7345199a9aef53500469c8fc94acf3603d171cfe 100644 (file)
 #if USE_AUTH
 
 #include "auth/UserRequest.h"
+#include "CachePeer.h"
 #include "globals.h"
 #include "HttpRequest.h"
 #include "mgr/Registration.h"
 #include "neighbors.h"
+#include "SquidConfig.h"
 #include "Store.h"
 
 #if HAVE_MATH_H
 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
 
 static int n_userhash_peers = 0;
-static peer **userhash_peers = NULL;
+static CachePeer **userhash_peers = NULL;
 static OBJH peerUserHashCachemgr;
 static void peerUserHashRegisterWithCacheManager(void);
 
 static int
 peerSortWeight(const void *a, const void *b)
 {
-    const peer *const *p1 = (const peer *const *)a;
-    const peer *const *p2 = (const peer *const *)b;
+    const CachePeer *const *p1 = (const CachePeer *const *)a;
+    const CachePeer *const *p2 = (const CachePeer *const *)b;
     return (*p1)->weight - (*p2)->weight;
 }
 
@@ -69,8 +71,8 @@ peerUserHashInit(void)
     int K;
     int k;
     double P_last, X_last, Xn;
-    peer *p;
-    peer **P;
+    CachePeer *p;
+    CachePeer **P;
     char *t;
     /* Clean up */
 
@@ -101,7 +103,7 @@ peerUserHashInit(void)
     if (n_userhash_peers == 0)
         return;
 
-    userhash_peers = (peer **)xcalloc(n_userhash_peers, sizeof(*userhash_peers));
+    userhash_peers = (CachePeer **)xcalloc(n_userhash_peers, sizeof(*userhash_peers));
 
     /* Build a list of the found peers and calculate hashes and load factors */
     for (P = userhash_peers, p = Config.peers; p; p = p->next) {
@@ -169,13 +171,13 @@ peerUserHashRegisterWithCacheManager(void)
                         0, 1);
 }
 
-peer *
+CachePeer *
 peerUserHashSelectParent(HttpRequest * request)
 {
     int k;
     const char *c;
-    peer *p = NULL;
-    peer *tp;
+    CachePeer *p = NULL;
+    CachePeer *tp;
     unsigned int user_hash = 0;
     unsigned int combined_hash;
     double score;
@@ -197,7 +199,7 @@ peerUserHashSelectParent(HttpRequest * request)
     for (c = key; *c != 0; ++c)
         user_hash += ROTATE_LEFT(user_hash, 19) + *c;
 
-    /* select peer */
+    /* select CachePeer */
     for (k = 0; k < n_userhash_peers; ++k) {
         tp = userhash_peers[k];
         combined_hash = (user_hash ^ tp->userhash.hash);
@@ -222,7 +224,7 @@ peerUserHashSelectParent(HttpRequest * request)
 static void
 peerUserHashCachemgr(StoreEntry * sentry)
 {
-    peer *p;
+    CachePeer *p;
     int sumfetches = 0;
     storeAppendPrintf(sentry, "%24s %10s %10s %10s %10s\n",
                       "Hostname",
index b1dc6ccc330099349b300e0f8a7cc58fc832c49f..28ff77bdc021beb335714299e3b7025c6f7990ce 100644 (file)
 #ifndef SQUID_PEER_USERHASH_H_
 #define SQUID_PEER_USERHASH_H_
 
-class peer;
+class CachePeer;
 class HttpRequest;
 
-extern void peerUserHashInit(void);
-extern peer * peerUserHashSelectParent(HttpRequest * request);
+void peerUserHashInit(void);
+CachePeer * peerUserHashSelectParent(HttpRequest * request);
 
 #endif /* SQUID_PEER_USERHASH_H_ */
index ed58a3d59e225397b1bc98acf93a6258b8d61d5d..5f90b1418fbf98c5318b739f60f6f4748e818cc4 100644 (file)
@@ -29,8 +29,8 @@
 #ifndef SQUID_PROTOS_H
 #define SQUID_PROTOS_H
 
-extern void shut_down(int);
-extern void rotate_logs(int);
-extern void reconfigure(int);
+void shut_down(int);
+void rotate_logs(int);
+void reconfigure(int);
 
 #endif /* SQUID_PROTOS_H */
index ef46b9cffcaec0b07de647e9a714945594ee50fd..bb021be12a386efc8d5a0d8c7917a55229b9186a 100644 (file)
@@ -44,6 +44,7 @@
 #include "mgr/Registration.h"
 #include "redirect.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
index dd74a033e3934101e92daef25c37ead972d7748e..6cbbdd3161e39bb164de4ed9d92b10085b157dc6 100644 (file)
@@ -33,7 +33,7 @@
  *
  */
 
-extern void redirectInit(void);
-extern void redirectShutdown(void);
+void redirectInit(void);
+void redirectShutdown(void);
 
 #endif /* SQUID_REDIRECT_H_ */
index 15b39cefaf70a8c298f498351f9f3c348fc74abc..fe92ca6705d5abb7e3136570c66e0c2cc7d3d1eb 100644 (file)
@@ -41,7 +41,9 @@
 #include "HttpRequest.h"
 #include "HttpReply.h"
 #include "MemObject.h"
+#include "RefreshPattern.h"
 #include "SquidTime.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "URL.h"
 
@@ -108,16 +110,16 @@ refreshCounts[rcCount];
 #define REFRESH_DEFAULT_PCT    0.20
 #define REFRESH_DEFAULT_MAX    (time_t)259200
 
-static const refresh_t *refreshUncompiledPattern(const char *);
+static const RefreshPattern *refreshUncompiledPattern(const char *);
 static OBJH refreshStats;
-static int refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const refresh_t * R, stale_flags * sf);
+static int refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const RefreshPattern * R, stale_flags * sf);
 
-static refresh_t DefaultRefresh;
+static RefreshPattern DefaultRefresh;
 
-const refresh_t *
+const RefreshPattern *
 refreshLimits(const char *url)
 {
-    const refresh_t *R;
+    const RefreshPattern *R;
 
     for (R = Config.Refresh; R; R = R->next) {
         if (!regexec(&(R->compiled_pattern), url, 0, 0, 0))
@@ -127,10 +129,10 @@ refreshLimits(const char *url)
     return NULL;
 }
 
-static const refresh_t *
+static const RefreshPattern *
 refreshUncompiledPattern(const char *pat)
 {
-    const refresh_t *R;
+    const RefreshPattern *R;
 
     for (R = Config.Refresh; R; R = R->next) {
         if (0 == strcmp(R->pattern, pat))
@@ -156,7 +158,7 @@ refreshUncompiledPattern(const char *pat)
  * times.
  */
 static int
-refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const refresh_t * R, stale_flags * sf)
+refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age, const RefreshPattern * R, stale_flags * sf)
 {
     /** \par
      * Check for an explicit expiration time (Expires: header).
@@ -230,7 +232,7 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age,
 static int
 refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
 {
-    const refresh_t *R;
+    const RefreshPattern *R;
     const char *uri = NULL;
     time_t age = 0;
     time_t check_time = squid_curtime + delta;
@@ -265,7 +267,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
 
     debugs(22, 3, "\tentry->timestamp:\t" << mkrfc1123(entry->timestamp));
 
-    if (request && !request->flags.ignore_cc) {
+    if (request && !request->flags.ignoreCc) {
         const HttpHdrCc *const cc = request->cache_control;
         if (cc && cc->hasMinFresh()) {
             const int32_t minFresh=cc->minFresh();
@@ -291,7 +293,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
             entry->mem_obj->getReply()->cache_control->staleIfError() < staleness) {
 
         debugs(22, 3, "refreshCheck: stale-if-error period expired.");
-        request->flags.fail_on_validation_err = 1;
+        request->flags.failOnValidationError = 1;
     }
 
     if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE) && staleness > -1
@@ -301,12 +303,12 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
        ) {
         debugs(22, 3, "refreshCheck: YES: Must revalidate stale response");
         if (request)
-            request->flags.fail_on_validation_err = 1;
+            request->flags.failOnValidationError = 1;
         return STALE_MUST_REVALIDATE;
     }
 
     /* request-specific checks */
-    if (request && !request->flags.ignore_cc) {
+    if (request && !request->flags.ignoreCc) {
         HttpHdrCc *cc = request->cache_control;
 
         if (request->flags.ims && (R->flags.refresh_ims || Config.onoff.refresh_all_ims)) {
@@ -317,7 +319,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
 
 #if USE_HTTP_VIOLATIONS
 
-        if (!request->flags.nocache_hack) {
+        if (!request->flags.noCacheHack()) {
             (void) 0;
         } else if (R->flags.ignore_reload) {
             /* The clients no-cache header is ignored */
@@ -329,7 +331,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
         } else {
             /* The clients no-cache header is not overridden on this request */
             debugs(22, 3, "refreshCheck: YES: client reload");
-            request->flags.nocache = 1;
+            request->flags.noCache = 1;
             return STALE_FORCED_RELOAD;
         }
 
@@ -396,7 +398,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
     if ( max_stale >= 0 && staleness > max_stale) {
         debugs(22, 3, "refreshCheck: YES: max-stale limit");
         if (request)
-            request->flags.fail_on_validation_err = 1;
+            request->flags.failOnValidationError = 1;
         return STALE_MAX_STALE;
     }
 
@@ -492,7 +494,7 @@ refreshCheckHTTP(const StoreEntry * entry, HttpRequest * request)
     int reason = refreshCheck(entry, request, 0);
     ++ refreshCounts[rcHTTP].total;
     ++ refreshCounts[rcHTTP].status[reason];
-    request->flags.stale_if_hit = refreshIsStaleIfHit(reason);
+    request->flags.staleIfHit = refreshIsStaleIfHit(reason);
     return (Config.onoff.offline || reason < 200) ? 0 : 1;
 }
 
@@ -534,7 +536,7 @@ refreshCheckDigest(const StoreEntry * entry, time_t delta)
 time_t
 getMaxAge(const char *url)
 {
-    const refresh_t *R;
+    const RefreshPattern *R;
     debugs(22, 3, "getMaxAge: '" << url << "'");
 
     if ((R = refreshLimits(url)))
index 1c6b9d36d29618652da7fd0876c839fa386ffb93..869f1439176d57815e16f2d143497d13e1439e8f 100644 (file)
 #ifndef SQUID_REFRESH_H_
 #define SQUID_REFRESH_H_
 
-extern void refreshAddToList(const char *, int, time_t, int, time_t);
-extern int refreshIsCachable(const StoreEntry *);
-extern int refreshCheckHTTP(const StoreEntry *, HttpRequest *);
-extern int refreshCheckICP(const StoreEntry *, HttpRequest *);
-extern int refreshCheckHTCP(const StoreEntry *, HttpRequest *);
-extern int refreshCheckDigest(const StoreEntry *, time_t delta);
-extern time_t getMaxAge(const char *url);
-extern void refreshInit(void);
-extern const refresh_t *refreshLimits(const char *url);
+class RefreshPattern;
+
+void refreshAddToList(const char *, int, time_t, int, time_t);
+int refreshIsCachable(const StoreEntry *);
+int refreshCheckHTTP(const StoreEntry *, HttpRequest *);
+int refreshCheckICP(const StoreEntry *, HttpRequest *);
+int refreshCheckHTCP(const StoreEntry *, HttpRequest *);
+int refreshCheckDigest(const StoreEntry *, time_t delta);
+time_t getMaxAge(const char *url);
+void refreshInit(void);
+const RefreshPattern *refreshLimits(const char *url);
 
 #endif /* SQUID_REFRESH_H_ */
index ec0dd98d122b90b2ab32500b29d1bc60cae9f6bb..e4f7e0772bbe66bb32090e6ca7d65728c8e0cb28 100644 (file)
@@ -33,6 +33,6 @@
  * Note: repl_modules.cc will be autogenerated.
  */
 
-extern void storeReplSetup(void);
+void storeReplSetup(void);
 
 #endif /* SQUID_REPL_MODULES_H_ */
index b96cc88ce9941a833a28d33048a20e09280708f5..45519dd875edfdeeff0cb15641327f8be568dcac 100644 (file)
@@ -39,6 +39,7 @@
 #include "globals.h"
 #include "ICP.h"
 #include "ipcache.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "tools.h"
 
index 646930052646b80099b187151f82f229e9750e05..c35dd8a5de3a44bf5c58664cbfa4fcf79a6c7c31 100644 (file)
@@ -32,6 +32,6 @@
  *
  */
 
-extern void start_announce(void *unused);
+void start_announce(void *unused);
 
 #endif /* SQUID_SEND_ANNOUNCE_H_ */
index 247875c3b9ec33d9119c15afdf52fa920d4b510c..632d3f2d6acdee1cb138ea634130eb549ce159d6 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "cache_snmp.h"
 #include "globals.h"
 #include "mem_node.h"
@@ -39,6 +40,7 @@
 #include "snmp_core.h"
 #include "StatCounters.h"
 #include "StatHist.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 #include "stat.h"
@@ -207,7 +209,7 @@ snmp_meshPtblFn(variable_list * Var, snint * ErrP)
 
     Ip::Address laddr;
     char *cp = NULL;
-    peer *p = NULL;
+    CachePeer *p = NULL;
     int cnt = 0;
     debugs(49, 5, "snmp_meshPtblFn: peer " << Var->name[LEN_SQ_MESH + 3] << " requested!");
     *ErrP = SNMP_ERR_NOERROR;
index 888183bc9a24114d02940aa20d43a086550f2a50..bfcc50fd7d98fc7c4c231ccdaac0456916a17768 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef SQUID_SNMP_AGENT_H_
 #define SQUID_SNMP_AGENT_H_
 /*
- * DEBUG: section
- * AUTHOR:
+ * DEBUG: section 49    SNMP Interface
+ * AUTHOR: Kostas Anagnostakis
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
 
 #include "snmp_vars.h"
 
-extern variable_list *snmp_confFn(variable_list *, snint *);
-extern variable_list *snmp_sysFn(variable_list *, snint *);
-extern variable_list *snmp_prfSysFn(variable_list *, snint *);
-extern variable_list *snmp_prfProtoFn(variable_list *, snint *);
-extern variable_list *snmp_netIpFn(variable_list *, snint *);
-extern variable_list *snmp_netFqdnFn(variable_list *, snint *);
-extern variable_list *snmp_netDnsFn(variable_list *, snint *);
-extern variable_list *snmp_meshPtblFn(variable_list *, snint *);
-extern variable_list *snmp_meshCtblFn(variable_list *, snint *);
+variable_list *snmp_confFn(variable_list *, snint *);
+variable_list *snmp_sysFn(variable_list *, snint *);
+variable_list *snmp_prfSysFn(variable_list *, snint *);
+variable_list *snmp_prfProtoFn(variable_list *, snint *);
+variable_list *snmp_netIpFn(variable_list *, snint *);
+variable_list *snmp_netFqdnFn(variable_list *, snint *);
+variable_list *snmp_netDnsFn(variable_list *, snint *);
+variable_list *snmp_meshPtblFn(variable_list *, snint *);
+variable_list *snmp_meshCtblFn(variable_list *, snint *);
 
 #endif /* SQUID_SNMP */
 #endif /* SQUID_SNMP_AGENT_H_ */
index 235bca50b584abd1655a2e5ecb0a7fe0d9fd608e..4c9d45b6ccfeabb748e584324035aaffe7e87f06 100644 (file)
@@ -32,6 +32,7 @@
 #include "squid.h"
 #include "acl/FilledChecklist.h"
 #include "base/CbcPointer.h"
+#include "CachePeer.h"
 #include "client_db.h"
 #include "comm.h"
 #include "comm/Connection.h"
@@ -42,6 +43,8 @@
 #include "snmp_agent.h"
 #include "snmp_core.h"
 #include "snmp/Forwarder.h"
+#include "SnmpRequest.h"
+#include "SquidConfig.h"
 #include "tools.h"
 
 static void snmpPortOpened(const Comm::ConnectionPointer &conn, int errNo);
@@ -62,8 +65,8 @@ static oid *static_Inst(oid * name, snint * len, mib_tree_entry * current, oid_P
 static oid *time_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
 static oid *peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
 static oid *client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
-static void snmpDecodePacket(snmp_request_t * rq);
-static void snmpConstructReponse(snmp_request_t * rq);
+static void snmpDecodePacket(SnmpRequest * rq);
+static void snmpConstructReponse(SnmpRequest * rq);
 
 static oid_ParseFn *snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen);
 static oid_ParseFn *snmpTreeGet(oid * Current, snint CurrentLen);
@@ -361,7 +364,7 @@ snmpHandleUdp(int sock, void *not_used)
 {
     LOCAL_ARRAY(char, buf, SNMP_REQUEST_SIZE);
     Ip::Address from;
-    snmp_request_t *snmp_rq;
+    SnmpRequest *snmp_rq;
     int len;
 
     debugs(49, 5, "snmpHandleUdp: Called.");
@@ -380,7 +383,7 @@ snmpHandleUdp(int sock, void *not_used)
         buf[len] = '\0';
         debugs(49, 3, "snmpHandleUdp: FD " << sock << ": received " << len << " bytes from " << from << ".");
 
-        snmp_rq = (snmp_request_t *)xcalloc(1, sizeof(snmp_request_t));
+        snmp_rq = (SnmpRequest *)xcalloc(1, sizeof(SnmpRequest));
         snmp_rq->buf = (u_char *) buf;
         snmp_rq->len = len;
         snmp_rq->sock = sock;
@@ -398,7 +401,7 @@ snmpHandleUdp(int sock, void *not_used)
  * Turn SNMP packet into a PDU, check available ACL's
  */
 static void
-snmpDecodePacket(snmp_request_t * rq)
+snmpDecodePacket(SnmpRequest * rq)
 {
     struct snmp_pdu *PDU;
     u_char *Community;
@@ -445,7 +448,7 @@ snmpDecodePacket(snmp_request_t * rq)
  * Packet OK, ACL Check OK, Create reponse.
  */
 static void
-snmpConstructReponse(snmp_request_t * rq)
+snmpConstructReponse(SnmpRequest * rq)
 {
 
     struct snmp_pdu *RespPDU;
@@ -747,7 +750,7 @@ static oid *
 peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
 {
     oid *instance = NULL;
-    peer *peers = Config.peers;
+    CachePeer *peers = Config.peers;
 
     if (peers == NULL) {
         debugs(49, 6, "snmp peer_Inst: No Peers.");
index f73f46f0b02e44a901ce9ba334d54e50b0a2f5fb..1f545f5c4603ac69177c02d67d93e120af2a6b51 100644 (file)
@@ -36,17 +36,17 @@ struct _mib_tree_entry {
     AggrType aggrType;
 };
 
-extern struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
-extern AggrType snmpAggrType(oid* Current, snint CurrentLen);
+struct snmp_pdu* snmpAgentResponse(struct snmp_pdu* PDU);
+AggrType snmpAggrType(oid* Current, snint CurrentLen);
 
 extern Comm::ConnectionPointer snmpOutgoingConn;
 
 extern PF snmpHandleUdp;
-extern void snmpInit(void);
-extern void snmpOpenPorts(void);
-extern void snmpClosePorts(void);
-extern const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
-extern void addr2oid(Ip::Address &addr, oid *Dest);
-extern void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
+void snmpInit(void);
+void snmpOpenPorts(void);
+void snmpClosePorts(void);
+const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
+void addr2oid(Ip::Address &addr, oid *Dest);
+void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
 
 #endif /* SQUID_SNMP_CORE_H */
index 1b47a484c98bd024c1d893c4f9582c562c5a0f9e..18b7a34b97bdb0e31618eb08af929bbe85d7e5fb 100644 (file)
@@ -29,6 +29,7 @@ libsslsquid_la_SOURCES = \
        ErrorDetail.h \
        ErrorDetailManager.cc \
        ErrorDetailManager.h \
+       ProxyCerts.h \
        ServerBump.cc \
        ServerBump.h \
        support.cc \
diff --git a/src/ssl/ProxyCerts.h b/src/ssl/ProxyCerts.h
new file mode 100644 (file)
index 0000000..22b4eda
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef SQUID_SSLPROXYCERTS_H_
+#define SQUID_SSLPROXYCERTS_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.
+ *
+ */
+
+#if USE_SSL
+class ACLList;
+
+class sslproxy_cert_sign {
+public:
+    int alg;
+    ACLList *aclList;
+    sslproxy_cert_sign *next;
+};
+
+class sslproxy_cert_adapt {
+public:
+    int alg;
+    char *param;
+    ACLList *aclList;
+    sslproxy_cert_adapt *next;
+};
+#endif
+
+#endif /* SQUID_SSLPROXYCERTS_H_ */
index a1ffb0f3e53b7a4ca9d889455d6da7a458c7fe9f..6237a264d1dc2b330e42c4cd5e5da410c5ef7319 100644 (file)
@@ -9,6 +9,9 @@
 #if HAVE_LIMITS
 #include <limits>
 #endif
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
 
 Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &cmd)
         :   Mgr::Action(cmd)
index 6aa01c9ae08f879e605480a470283718033b2e3c..0c5b83d1987366f0b196de41b277886f3a709009 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "SquidTime.h"
 #include "CacheManager.h"
+#include "ip/Address.h"
 #include "mgr/Action.h"
 #include "mgr/Command.h"
 #if HAVE_MAP
@@ -17,6 +18,7 @@
 #if HAVE_LIST
 #include <list>
 #endif
+#include <openssl/ssl.h>
 
 /// TODO: Replace on real size.
 #define SSL_CTX_SIZE 1024
index 0f76cebf0bb1613124950ff16d5f4ab57efdd16d..6c8803b99fa9726230a1ab3d30475748f2d92a2d 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * 2008/11/14
- */
-
 #include "squid.h"
 #include "anyp/PortCfg.h"
 #include "ssl/Config.h"
@@ -10,6 +6,7 @@
 #include "SquidTime.h"
 #include "SwapDir.h"
 #include "wordlist.h"
+#include "SquidConfig.h"
 
 Ssl::Helper * Ssl::Helper::GetInstance()
 {
index aaaa63a5c99f4ad21980943176340c96fb7cc6d3..8cc8b634750f9bb42f4b872b789259b7e02e5eb8 100644 (file)
@@ -42,6 +42,7 @@
 #include "anyp/PortCfg.h"
 #include "fde.h"
 #include "globals.h"
+#include "SquidConfig.h"
 #include "ssl/ErrorDetail.h"
 #include "ssl/support.h"
 #include "ssl/gadgets.h"
index 830da56d70682cf9168156602b5148356838309c..d65681eeeeaf1d8e4aef97848503dfe71627bf2b 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "CacheDigest.h"
+#include "CachePeer.h"
 #include "client_side_request.h"
 #include "client_side.h"
 #include "comm/Connection.h"
@@ -41,6 +42,7 @@
 #include "format/Token.h"
 #include "globals.h"
 #include "HttpRequest.h"
+#include "IoStats.h"
 #include "MemObject.h"
 #include "mem_node.h"
 #include "MemBuf.h"
@@ -53,6 +55,7 @@
 #include "mgr/ServiceTimesAction.h"
 #include "neighbors.h"
 #include "PeerDigest.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
@@ -219,19 +222,19 @@ GetIoStats(Mgr::IoActionData& stats)
 
     stats.http_reads = IOStats.Http.reads;
 
-    for (i = 0; i < _iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         stats.http_read_hist[i] = IOStats.Http.read_hist[i];
     }
 
     stats.ftp_reads = IOStats.Ftp.reads;
 
-    for (i = 0; i < _iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         stats.ftp_read_hist[i] = IOStats.Ftp.read_hist[i];
     }
 
     stats.gopher_reads = IOStats.Gopher.reads;
 
-    for (i = 0; i < _iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         stats.gopher_read_hist[i] = IOStats.Gopher.read_hist[i];
     }
 }
@@ -245,7 +248,7 @@ DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.http_reads);
     storeAppendPrintf(sentry, "Read Histogram:\n");
 
-    for (i = 0; i < _iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
                           i ? (1 << (i - 1)) + 1 : 1,
                           1 << i,
@@ -258,7 +261,7 @@ DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.ftp_reads);
     storeAppendPrintf(sentry, "Read Histogram:\n");
 
-    for (i = 0; i < _iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
                           i ? (1 << (i - 1)) + 1 : 1,
                           1 << i,
@@ -271,7 +274,7 @@ DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.gopher_reads);
     storeAppendPrintf(sentry, "Read Histogram:\n");
 
-    for (i = 0; i < _iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
                           i ? (1 << (i - 1)) + 1 : 1,
                           1 << i,
@@ -1810,7 +1813,7 @@ statPeerSelect(StoreEntry * sentry)
 {
 #if USE_CACHE_DIGESTS
     StatCounters *f = &statCounter;
-    peer *peer;
+    CachePeer *peer;
     const int tot_used = f->cd.times_used + f->icp.times_used;
 
     /* totals */
index 9a8055fb01dcb31a9a1fdfd7b47b52c5c2e89ea3..3de1aa83589e3bf108862d7372bc0d7bf0ba1fc3 100644 (file)
 #ifndef SQUID_STAT_H_
 #define SQUID_STAT_H_
 
-extern void statInit(void);
-extern void statFreeMemory(void);
-extern double median_svc_get(int, int);
-extern void pconnHistCount(int, int);
-extern int stat5minClientRequests(void);
-extern double stat5minCPUUsage(void);
-extern double statRequestHitRatio(int minutes);
-extern double statRequestHitMemoryRatio(int minutes);
-extern double statRequestHitDiskRatio(int minutes);
-extern double statByteHitRatio(int minutes);
+void statInit(void);
+void statFreeMemory(void);
+double median_svc_get(int, int);
+void pconnHistCount(int, int);
+int stat5minClientRequests(void);
+double stat5minCPUUsage(void);
+double statRequestHitRatio(int minutes);
+double statRequestHitMemoryRatio(int minutes);
+double statRequestHitDiskRatio(int minutes);
+double statByteHitRatio(int minutes);
 
 class StatCounters;
-extern StatCounters *snmpStatGet(int);
+StatCounters *snmpStatGet(int);
 
 #endif /* SQUID_STAT_H_ */
index 9d7f77e9bb3713e223f6d88325d9fb49357ac6a6..cb415f1fc47998e05430e3f4a600ca48fc5525b0 100644 (file)
@@ -48,6 +48,8 @@
 #include "mgr/StoreIoAction.h"
 #include "profiler/Profiler.h"
 #include "repl_modules.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Stack.h"
 #include "StatCounters.h"
@@ -816,7 +818,7 @@ StoreEntry::setPublicKey()
 }
 
 StoreEntry *
-storeCreateEntry(const char *url, const char *log_url, request_flags flags, const HttpRequestMethod& method)
+storeCreateEntry(const char *url, const char *log_url, const RequestFlags &flags, const HttpRequestMethod& method)
 {
     StoreEntry *e = NULL;
     MemObject *mem = NULL;
@@ -1965,7 +1967,7 @@ StoreEntry::hasIfNoneMatchEtag(const HttpRequest &request) const
 {
     const String reqETags = request.header.getList(HDR_IF_NONE_MATCH);
     // weak comparison is allowed only for HEAD or full-body GET requests
-    const bool allowWeakMatch = !request.flags.range &&
+    const bool allowWeakMatch = !request.flags.isRanged &&
                                 (request.method == METHOD_GET || request.method == METHOD_HEAD);
     return hasOneOfEtags(reqETags, allowWeakMatch);
 }
index 2c4db1c68871e47bd0a26f61b764eb700d1b6a94..bd9949dd13844bc450cad274b3f05581a3667976 100644 (file)
@@ -40,6 +40,7 @@
 #include "MemObject.h"
 #include "mime_header.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "StatCounters.h"
 #include "StoreClient.h"
 #include "Store.h"
index 6a56d055e7bd93015a4f8d09a4bbcfa8024d98d6..b1133c83acb464140c81f0092845533f73a4497e 100644 (file)
@@ -51,6 +51,7 @@
 #include "MemObject.h"
 #include "PeerDigest.h"
 #include "refresh.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StoreSearch.h"
@@ -376,7 +377,7 @@ storeDigestRebuildStep(void *datanotused)
 static void
 storeDigestRewriteStart(void *datanotused)
 {
-    request_flags flags;
+    RequestFlags flags;
     char *url;
     StoreEntry *e;
 
index 73deb856c390f598c1ed8961d4bc59fe6237f97d..1c741c72c3807015cc2231f25184138e64a9040d 100644 (file)
@@ -34,9 +34,9 @@
 
 class StoreEntry;
 
-extern void storeDigestInit(void);
-extern void storeDigestNoteStoreReady(void);
-extern void storeDigestDel(const StoreEntry * entry);
-extern void storeDigestReport(StoreEntry *);
+void storeDigestInit(void);
+void storeDigestNoteStoreReady(void);
+void storeDigestDel(const StoreEntry * entry);
+void storeDigestReport(StoreEntry *);
 
 #endif /* SQUID_STORE_DIGEST_H_ */
index de10f782e242792f1e560dc34b8d3d456040f161..d8acbdb02c08d72379c4aca898648c85d60c043c 100644 (file)
@@ -37,6 +37,7 @@
 #include "MemObject.h"
 #include "MemStore.h"
 #include "profiler/Profiler.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 #include "Store.h"
index 797a5b34156b45a63840f18ca7571f06b46c4e70..403a050a56eaef0fdff25741d68fe42492a2fae0 100644 (file)
@@ -1,6 +1,7 @@
 #include "squid.h"
 #include "Store.h"
 #include "MemObject.h"
+#include "SquidConfig.h"
 #include "SwapDir.h"
 
 StoreIoStats store_io_stats;
index 54b35d4d7a9afc87a292790ddaf67d3961f4f035..1048c3b92d4eba988b5cf00863582cea57e5e44d 100644 (file)
 class HttpRequestMethod;
 class HttpRequest;
 
-extern cache_key *storeKeyDup(const cache_key *);
-extern cache_key *storeKeyCopy(cache_key *, const cache_key *);
-extern void storeKeyFree(const cache_key *);
-extern const cache_key *storeKeyScan(const char *);
-extern const char *storeKeyText(const cache_key *);
-extern const cache_key *storeKeyPublic(const char *, const HttpRequestMethod&);
-extern const cache_key *storeKeyPublicByRequest(HttpRequest *);
-extern const cache_key *storeKeyPublicByRequestMethod(HttpRequest *, const HttpRequestMethod&);
-extern const cache_key *storeKeyPrivate(const char *, const HttpRequestMethod&, int);
-extern int storeKeyHashBuckets(int);
-extern int storeKeyNull(const cache_key *);
-extern void storeKeyInit(void);
+cache_key *storeKeyDup(const cache_key *);
+cache_key *storeKeyCopy(cache_key *, const cache_key *);
+void storeKeyFree(const cache_key *);
+const cache_key *storeKeyScan(const char *);
+const char *storeKeyText(const cache_key *);
+const cache_key *storeKeyPublic(const char *, const HttpRequestMethod&);
+const cache_key *storeKeyPublicByRequest(HttpRequest *);
+const cache_key *storeKeyPublicByRequestMethod(HttpRequest *, const HttpRequestMethod&);
+const cache_key *storeKeyPrivate(const char *, const HttpRequestMethod&, int);
+int storeKeyHashBuckets(int);
+int storeKeyNull(const cache_key *);
+void storeKeyInit(void);
 
 extern HASHHASH storeKeyHashHash;
 extern HASHCMP storeKeyHashCmp;
index 093040a029a805cae9b5d877a37643252b5fb6e8..9464857f32fb808e9a7a32e2fdf8969eef76a9b8 100644 (file)
@@ -38,6 +38,7 @@
 #include "mgr/Registration.h"
 #include "Store.h"
 #include "store_log.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 static const char *storeLogTags[] = {
index d99786e4a2e8ec4665daf8cfe32c402853ec2fab..6585b9c1377c55ad2e86231ce33af474a877fc68 100644 (file)
@@ -34,9 +34,9 @@
 
 class StoreEntry;
 
-extern void storeLog(int tag, const StoreEntry * e);
-extern void storeLogRotate(void);
-extern void storeLogClose(void);
-extern void storeLogOpen(void);
+void storeLog(int tag, const StoreEntry * e);
+void storeLogRotate(void);
+void storeLogClose(void);
+void storeLogOpen(void);
 
 #endif /* SQUID_STORE_LOG_H_ */
index f4b1370ba43b1fad52946e7e6411139e10538a83..a601b06e6c2a7b9d6398e2a50b2ac6d36abcffc9 100644 (file)
 #include "store_digest.h"
 #include "store_rebuild.h"
 #include "StoreSearch.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
-static struct _store_rebuild_data counts;
+static StoreRebuildData counts;
 
 static struct timeval rebuild_start;
 static void storeCleanup(void *);
@@ -136,7 +137,7 @@ storeCleanup(void *datanotused)
 /* meta data recreated from disk image in swap directory */
 void
 
-storeRebuildComplete(struct _store_rebuild_data *dc)
+storeRebuildComplete(StoreRebuildData *dc)
 {
     double dt;
     counts.objcount += dc->objcount;
@@ -294,7 +295,7 @@ struct InitStoreEntry : public unary_function<StoreMeta, void> {
 
 bool
 storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf,
-                      struct _store_rebuild_data &counts)
+                      StoreRebuildData &counts)
 {
     if (fd < 0)
         return false;
@@ -316,7 +317,7 @@ storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf,
 
 bool
 storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
-                       struct _store_rebuild_data &counts,
+                       StoreRebuildData &counts,
                        uint64_t expectedSize)
 {
     int swap_hdr_len = 0;
@@ -382,7 +383,7 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
 
 bool
 storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key,
-                      struct _store_rebuild_data &counts)
+                      StoreRebuildData &counts)
 {
     /* this needs to become
      * 1) unpack url
index 64998dbcdbe13a4a36daf31d2b04a15e9da806af..6cc239a5feb64727866496d0d45ad2ef50631544 100644 (file)
  *
  */
 
-extern void storeRebuildStart(void);
-extern void storeRebuildComplete(struct _store_rebuild_data *);
-extern void storeRebuildProgress(int sd_index, int total, int sofar);
+// currently a POD
+class StoreRebuildData
+{
+public:
+    int objcount;       /* # objects successfully reloaded */
+    int expcount;       /* # objects expired */
+    int scancount;      /* # entries scanned or read from state file */
+    int clashcount;     /* # swapfile clashes avoided */
+    int dupcount;       /* # duplicates purged */
+    int cancelcount;        /* # SWAP_LOG_DEL objects purged */
+    int invalid;        /* # bad lines */
+    int badflags;       /* # bad e->flags */
+    int bad_log_op;
+    int zero_object_sz;
+};
+
+void storeRebuildStart(void);
+void storeRebuildComplete(StoreRebuildData *);
+void storeRebuildProgress(int sd_index, int total, int sofar);
 
 /// loads entry from disk; fills supplied memory buffer on success
-extern bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, struct _store_rebuild_data &counts);
+bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &counts);
 /// parses entry buffer and validates entry metadata; fills e on success
-extern bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &e, cache_key *key, struct _store_rebuild_data &counts, uint64_t expectedSize);
+bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &e, cache_key *key, StoreRebuildData &counts, uint64_t expectedSize);
 /// checks whether the loaded entry should be kept; updates counters
-extern bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, struct _store_rebuild_data &counts);
+bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, StoreRebuildData &counts);
 
 #endif /* SQUID_STORE_REBUILD_H_ */
index 10449717005480adbb743a3878e191b4ad1124ae..f7c5ad3dc5fc472cbbb8a5f02e2fc5970e23316b 100644 (file)
@@ -33,6 +33,6 @@
  */
 
 class store_client;
-extern void storeSwapInStart(store_client *);
+void storeSwapInStart(store_client *);
 
 #endif /* SQUID_STORE_SWAPIN_H_ */
index 4281334e0cf41c02332012033867168908b227d4..f148c68aa170eac9532cb971cf4597232b40fec2 100644 (file)
@@ -39,6 +39,7 @@
 /* FIXME: Abstract the use of this more */
 #include "mem_node.h"
 #include "MemObject.h"
+#include "SquidConfig.h"
 #include "SwapDir.h"
 #include "StatCounters.h"
 #include "store_log.h"
index 0633924959b05073926448b7b954bfdd3cfaa086..0355753f3273d32170479cedc7b8cc277b08b1b6 100644 (file)
 #ifndef SQUID_STRUCTS_H
 #define SQUID_STRUCTS_H
 
-#include "RefCount.h"
-#include "cbdata.h"
 #include "defines.h"
-#include "dlink.h"
-#include "err_type.h"
-#include "hash.h"
-#include "ip/Address.h"
-
-/* needed for the global config */
-#include "HttpHeader.h"
-#include "HttpHeaderTools.h"
-
-/* for ICP_END */
-#include "icp_opcode.h"
-
-#if USE_SSL
-#include <openssl/ssl.h>
-#endif
-
-#define PEER_MULTICAST_SIBLINGS 1
-
-struct acl_name_list {
-    char name[ACL_NAME_SZ];
-    acl_name_list *next;
-};
-
-struct acl_deny_info_list {
-    err_type err_page_id;
-    char *err_page_name;
-    acl_name_list *acl_list;
-    acl_deny_info_list *next;
-};
-
-class ACLChecklist;
-
-#if SQUID_SNMP
-
-#include "snmp_session.h"
-struct _snmp_request_t {
-    u_char *buf;
-    u_char *outbuf;
-    int len;
-    int sock;
-    long reqid;
-    int outlen;
-
-    Ip::Address from;
-
-    struct snmp_pdu *PDU;
-    ACLChecklist *acl_checklist;
-    u_char *community;
-
-    struct snmp_session session;
-};
-
-#endif
+#include "typedefs.h"
 
 class ACLList;
 
-struct acl_address {
-    acl_address *next;
-    ACLList *aclList;
-
-    Ip::Address addr;
-};
-
-struct acl_tos {
-    acl_tos *next;
-    ACLList *aclList;
-    tos_t tos;
-};
-
-struct acl_nfmark {
-    acl_nfmark *next;
-    ACLList *aclList;
-    nfmark_t nfmark;
-};
-
 struct acl_size_t {
     acl_size_t *next;
     ACLList *aclList;
     int64_t size;
 };
 
-struct ushortlist {
-    unsigned short i;
-    ushortlist *next;
-};
-
-struct relist {
-    int flags;
-    char *pattern;
-    regex_t regex;
-    relist *next;
-};
-
-#if USE_DELAY_POOLS
-#include "DelayConfig.h"
-#include "ClientDelayConfig.h"
-#endif
-
-#if USE_ICMP
-#include "icmp/IcmpConfig.h"
-#endif
-
-#include "HelperChildConfig.h"
-
-/* forward decl for SquidConfig, see RemovalPolicy.h */
-
-class CpuAffinityMap;
-class RemovalPolicySettings;
-class external_acl;
-class Store;
-namespace AnyP
+// POD
+class dwrite_q
 {
-struct PortCfg;
-}
-class SwapDir;
-
-/// Used for boolean enabled/disabled options with complex default logic.
-/// Allows Squid to compute the right default after configuration.
-/// Checks that not-yet-defined option values are not used.
-class YesNoNone
-{
-// TODO: generalize to non-boolean option types
 public:
-    YesNoNone(): option(0) {}
-
-    /// returns true iff enabled; asserts if the option has not been configured
-    operator void *() const; // TODO: use a fancy/safer version of the operator
-
-    /// enables or disables the option;
-    void configure(bool beSet);
-
-    /// whether the option was enabled or disabled, by user or Squid
-    bool configured() const { return option != 0; }
-
-private:
-    enum { optUnspecified = -1, optDisabled = 0, optEnabled = 1 };
-    int option; ///< configured value or zero
-};
-
-struct SquidConfig {
-
-    struct {
-        /* These should be for the Store::Root instance.
-        * this needs pluggable parsing to be done smoothly.
-        */
-        int highWaterMark;
-        int lowWaterMark;
-    } Swap;
-
-    YesNoNone memShared; ///< whether the memory cache is shared among workers
-    size_t memMaxSize;
-
-    struct {
-        int64_t min;
-        int pct;
-        int64_t max;
-    } quickAbort;
-    int64_t readAheadGap;
-    RemovalPolicySettings *replPolicy;
-    RemovalPolicySettings *memPolicy;
-#if USE_HTTP_VIOLATIONS
-    time_t negativeTtl;
-#endif
-    time_t maxStale;
-    time_t negativeDnsTtl;
-    time_t positiveDnsTtl;
-    time_t shutdownLifetime;
-    time_t backgroundPingRate;
-
-    struct {
-        time_t read;
-        time_t write;
-        time_t lifetime;
-        time_t connect;
-        time_t forward;
-        time_t peer_connect;
-        time_t request;
-        time_t clientIdlePconn;
-        time_t serverIdlePconn;
-        time_t siteSelect;
-        time_t deadPeer;
-        int icp_query;         /* msec */
-        int icp_query_max;     /* msec */
-        int icp_query_min;     /* msec */
-        int mcast_icp_query;   /* msec */
-
-#if !USE_DNSHELPER
-        time_msec_t idns_retransmit;
-        time_msec_t idns_query;
-#endif
-
-    } Timeout;
-    size_t maxRequestHeaderSize;
-    int64_t maxRequestBodySize;
-    int64_t maxChunkedRequestBodySize;
-    size_t maxRequestBufferSize;
-    size_t maxReplyHeaderSize;
-    acl_size_t *ReplyBodySize;
-
-    struct {
-        unsigned short icp;
-#if USE_HTCP
-
-        unsigned short htcp;
-#endif
-#if SQUID_SNMP
-
-        unsigned short snmp;
-#endif
-    } Port;
-
-    struct {
-        AnyP::PortCfg *http;
-#if USE_SSL
-        AnyP::PortCfg *https;
-#endif
-    } Sockaddr;
-#if SQUID_SNMP
-
-    struct {
-        char *configFile;
-        char *agentInfo;
-    } Snmp;
-#endif
-#if USE_WCCP
-
-    struct {
-        Ip::Address router;
-        Ip::Address address;
-        int version;
-    } Wccp;
-#endif
-#if USE_WCCPv2
-
-    struct {
-        Ip::Address_list *router;
-        Ip::Address address;
-        int forwarding_method;
-        int return_method;
-        int assignment_method;
-        int weight;
-        int rebuildwait;
-        void *info;
-    } Wccp2;
-#endif
-
-#if USE_ICMP
-    IcmpConfig pinger;
-#endif
-
-    char *as_whois_server;
-
-    struct {
-        char *store;
-        char *swap;
-        customlog *accesslogs;
-#if ICAP_CLIENT
-        customlog *icaplogs;
-#endif
-        int rotateNumber;
-    } Log;
-    char *adminEmail;
-    char *EmailFrom;
-    char *EmailProgram;
-    char *effectiveUser;
-    char *visible_appname_string;
-    char *effectiveGroup;
-
-    struct {
-#if USE_DNSHELPER
-        char *dnsserver;
-#endif
-
-        wordlist *redirect;
-#if USE_UNLINKD
-
-        char *unlinkd;
-#endif
-
-        char *diskd;
-#if USE_SSL
-
-        char *ssl_password;
-#endif
-
-    } Program;
-#if USE_DNSHELPER
-    HelperChildConfig dnsChildren;
-#endif
-
-    HelperChildConfig redirectChildren;
-    time_t authenticateGCInterval;
-    time_t authenticateTTL;
-    time_t authenticateIpTTL;
-
-    struct {
-        char *surrogate_id;
-    } Accel;
-    char *appendDomain;
-    size_t appendDomainLen;
-    char *pidFilename;
-    char *netdbFilename;
-    char *mimeTablePathname;
-    char *etcHostsPath;
-    char *visibleHostname;
-    char *uniqueHostname;
-    wordlist *hostnameAliases;
-    char *errHtmlText;
-
-    struct {
-        char *host;
-        char *file;
-        time_t period;
-        unsigned short port;
-    } Announce;
-
-    struct {
-
-        Ip::Address udp_incoming;
-        Ip::Address udp_outgoing;
-#if SQUID_SNMP
-        Ip::Address snmp_incoming;
-        Ip::Address snmp_outgoing;
-#endif
-        /* FIXME INET6 : this should really be a CIDR value */
-        Ip::Address client_netmask;
-    } Addrs;
-    size_t tcpRcvBufsz;
-    size_t udpMaxHitObjsz;
-    wordlist *hierarchy_stoplist;
-    wordlist *mcast_group_list;
-    wordlist *dns_nameservers;
-    peer *peers;
-    int npeers;
-
-    struct {
-        int size;
-        int low;
-        int high;
-    } ipcache;
-
-    struct {
-        int size;
-    } fqdncache;
-    int minDirectHops;
-    int minDirectRtt;
-    cachemgr_passwd *passwd_list;
-
-    struct {
-        int objectsPerBucket;
-        int64_t avgObjectSize;
-        int64_t maxObjectSize;
-        int64_t minObjectSize;
-        size_t maxInMemObjSize;
-    } Store;
-
-    struct {
-        int high;
-        int low;
-        time_t period;
-    } Netdb;
-
-    struct {
-        int log_udp;
-        int res_defnames;
-        int anonymizer;
-        int client_db;
-        int query_icmp;
-        int icp_hit_stale;
-        int buffered_logs;
-        int common_log;
-        int log_mime_hdrs;
-        int log_fqdn;
-        int announce;
-        int mem_pools;
-        int test_reachability;
-        int half_closed_clients;
-        int refresh_all_ims;
-#if USE_HTTP_VIOLATIONS
-
-        int reload_into_ims;
-#endif
-
-        int offline;
-        int redir_rewrites_host;
-        int prefer_direct;
-        int nonhierarchical_direct;
-        int strip_query_terms;
-        int redirector_bypass;
-        int ignore_unknown_nameservers;
-        int client_pconns;
-        int server_pconns;
-        int error_pconns;
-#if USE_CACHE_DIGESTS
-
-        int digest_generation;
-#endif
-
-        int ie_refresh;
-        int vary_ignore_expire;
-        int pipeline_prefetch;
-        int surrogate_is_remote;
-        int request_entities;
-        int detect_broken_server_pconns;
-        int balance_on_multiple_ip;
-        int relaxed_header_parser;
-        int check_hostnames;
-        int allow_underscore;
-        int via;
-        int emailErrData;
-        int httpd_suppress_version_string;
-        int global_internal_static;
-
-#if FOLLOW_X_FORWARDED_FOR
-        int acl_uses_indirect_client;
-        int delay_pool_uses_indirect_client;
-        int log_uses_indirect_client;
-#if LINUX_NETFILTER
-        int tproxy_uses_indirect_client;
-#endif
-#endif /* FOLLOW_X_FORWARDED_FOR */
-
-        int WIN32_IpAddrChangeMonitor;
-        int memory_cache_first;
-        int memory_cache_disk;
-        int hostStrictVerify;
-        int client_dst_passthru;
-    } onoff;
-
-    int forward_max_tries;
-    int connect_retries;
-
-    class ACL *aclList;
-
-    struct {
-        acl_access *http;
-        acl_access *adapted_http;
-        acl_access *icp;
-        acl_access *miss;
-        acl_access *NeverDirect;
-        acl_access *AlwaysDirect;
-        acl_access *ASlists;
-        acl_access *noCache;
-        acl_access *log;
-#if SQUID_SNMP
-
-        acl_access *snmp;
-#endif
-#if USE_HTTP_VIOLATIONS
-        acl_access *brokenPosts;
-#endif
-        acl_access *redirector;
-        acl_access *reply;
-        acl_address *outgoing_address;
-#if USE_HTCP
-
-        acl_access *htcp;
-        acl_access *htcp_clr;
-#endif
-
-#if USE_SSL
-        acl_access *ssl_bump;
-#endif
-#if FOLLOW_X_FORWARDED_FOR
-        acl_access *followXFF;
-#endif /* FOLLOW_X_FORWARDED_FOR */
-
-#if ICAP_CLIENT
-        acl_access* icap;
-#endif
-    } accessList;
-    acl_deny_info_list *denyInfoList;
-
-    struct {
-        size_t list_width;
-        int list_wrap;
-        char *anon_user;
-        int passive;
-        int epsv_all;
-        int epsv;
-        int eprt;
-        int sanitycheck;
-        int telnet;
-    } Ftp;
-    refresh_t *Refresh;
-
-    struct _cacheSwap {
-        RefCount<SwapDir> *swapDirs;
-        int n_allocated;
-        int n_configured;
-        /// number of disk processes required to support all cache_dirs
-        int n_strands;
-    } cacheSwap;
-    /*
-     * I'm sick of having to keep doing this ..
-     */
-#define INDEXSD(i)   (Config.cacheSwap.swapDirs[(i)].getRaw())
-
-    struct {
-        char *directory;
-        int use_short_names;
-    } icons;
-    char *errorDirectory;
-#if USE_ERR_LOCALES
-    char *errorDefaultLanguage;
-    int errorLogMissingLanguages;
-#endif
-    char *errorStylesheet;
-
-    struct {
-        int onerror;
-    } retry;
-
-    struct {
-        int64_t limit;
-    } MemPools;
-#if USE_DELAY_POOLS
-
-    DelayConfig Delay;
-    ClientDelayConfig ClientDelay;
-#endif
-
-    struct {
-        struct {
-            int average;
-            int min_poll;
-        } dns, udp, tcp;
-    } comm_incoming;
-    int max_open_disk_fds;
-    int uri_whitespace;
-    acl_size_t *rangeOffsetLimit;
-#if MULTICAST_MISS_STREAM
-
-    struct {
-
-        Ip::Address addr;
-        int ttl;
-        unsigned short port;
-        char *encode_key;
-    } mcast_miss;
-#endif
-
-    /// request_header_access and request_header_replace
-    HeaderManglers *request_header_access;
-    /// reply_header_access and reply_header_replace
-    HeaderManglers *reply_header_access;
-    ///request_header_add access list
-    HeaderWithAclList *request_header_add;
-    char *coredump_dir;
-    char *chroot_dir;
-#if USE_CACHE_DIGESTS
-
-    struct {
-        int bits_per_entry;
-        time_t rebuild_period;
-        time_t rewrite_period;
-        size_t swapout_chunk_size;
-        int rebuild_chunk_percentage;
-    } digest;
-#endif
-#if USE_SSL
-
-    struct {
-        int unclean_shutdown;
-        char *ssl_engine;
-    } SSL;
-#endif
-
-    wordlist *ext_methods;
-
-    struct {
-        int high_rptm;
-        int high_pf;
-        size_t high_memory;
-    } warnings;
-    char *store_dir_select_algorithm;
-    int sleep_after_fork;      /* microseconds */
-    time_t minimum_expiry_time;        /* seconds */
-    external_acl *externalAclHelperList;
-
-#if USE_SSL
-
-    struct {
-        char *cert;
-        char *key;
-        int version;
-        char *options;
-        char *cipher;
-        char *cafile;
-        char *capath;
-        char *crlfile;
-        char *flags;
-        acl_access *cert_error;
-        SSL_CTX *sslContext;
-        sslproxy_cert_sign *cert_sign;
-        sslproxy_cert_adapt *cert_adapt;
-    } ssl_client;
-#endif
-
-    char *accept_filter;
-    int umask;
-    int max_filedescriptors;
-    int workers;
-    CpuAffinityMap *cpuAffinityMap;
-
-#if USE_LOADABLE_MODULES
-    wordlist *loadable_module_names;
-#endif
-
-    int client_ip_max_connections;
-
-    struct {
-        int v4_first;       ///< Place IPv4 first in the order of DNS results.
-        ssize_t packet_max; ///< maximum size EDNS advertised for DNS replies.
-    } dns;
-};
-
-SQUIDCEXTERN SquidConfig Config;
-
-struct SquidConfig2 {
-    struct {
-        int enable_purge;
-        int mangle_request_headers;
-    } onoff;
-    uid_t effectiveUserID;
-    gid_t effectiveGroupID;
-};
-
-SQUIDCEXTERN SquidConfig2 Config2;
-
-struct _close_handler {
-    PF *handler;
-    void *data;
-    close_handler *next;
-};
-
-struct _dread_ctrl {
-    int fd;
-    off_t offset;
-    int req_len;
-    char *buf;
-    int end_of_file;
-    DRCB *handler;
-    void *client_data;
-};
-
-struct _dwrite_q {
     off_t file_offset;
     char *buf;
     size_t len;
@@ -695,423 +60,4 @@ struct _fde_disk {
     off_t offset;
 };
 
-/* per field statistics */
-
-class HttpHeaderFieldStat
-{
-
-public:
-    HttpHeaderFieldStat() : aliveCount(0), seenCount(0), parsCount(0), errCount(0), repCount(0) {}
-
-    int aliveCount;            /* created but not destroyed (count) */
-    int seenCount;             /* #fields we've seen */
-    int parsCount;             /* #parsing attempts */
-    int errCount;              /* #pasring errors */
-    int repCount;              /* #repetitons */
-};
-
-/* compiled version of HttpHeaderFieldAttrs plus stats */
-#include "SquidString.h"
-
-class HttpHeaderFieldInfo
-{
-
-public:
-    HttpHeaderFieldInfo() : id (HDR_ACCEPT), type (ftInvalid) {}
-
-    http_hdr_type id;
-    String name;
-    field_type type;
-    HttpHeaderFieldStat stat;
-};
-
-struct _http_state_flags {
-    unsigned int proxying:1;
-    unsigned int keepalive:1;
-    unsigned int only_if_cached:1;
-    unsigned int handling1xx:1; ///< we are ignoring or forwarding 1xx response
-    unsigned int headers_parsed:1;
-    unsigned int front_end_https:2;
-    unsigned int originpeer:1;
-    unsigned int keepalive_broken:1;
-    unsigned int abuse_detected:1;
-    unsigned int request_sent:1;
-    unsigned int do_next_read:1;
-    unsigned int consume_body_data:1;
-    unsigned int chunked:1; ///< reading a chunked response; TODO: rename
-    unsigned int chunked_request:1; ///< writing a chunked request
-    unsigned int sentLastChunk:1; ///< do not try to write last-chunk again
-};
-
-struct _domain_ping {
-    char *domain;
-    int do_ping;               /* boolean */
-    domain_ping *next;
-};
-
-struct _domain_type {
-    char *domain;
-    peer_t type;
-    domain_type *next;
-};
-
-class PeerDigest;
-
-struct peer {
-    u_int index;
-    char *name;
-    char *host;
-    peer_t type;
-
-    Ip::Address in_addr;
-
-    struct {
-        int pings_sent;
-        int pings_acked;
-        int fetches;
-        int rtt;
-        int ignored_replies;
-        int n_keepalives_sent;
-        int n_keepalives_recv;
-        time_t probe_start;
-        time_t last_query;
-        time_t last_reply;
-        time_t last_connect_failure;
-        time_t last_connect_probe;
-        int logged_state;      /* so we can print dead/revived msgs */
-        int conn_open;         /* current opened connections */
-    } stats;
-
-    struct {
-        int version;
-        int counts[ICP_END+1];
-        unsigned short port;
-    } icp;
-
-#if USE_HTCP
-    struct {
-        double version;
-        int counts[2];
-        unsigned short port;
-    } htcp;
-#endif
-
-    unsigned short http_port;
-    domain_ping *peer_domain;
-    domain_type *typelist;
-    acl_access *access;
-
-    struct {
-        unsigned int proxy_only:1;
-        unsigned int no_query:1;
-        unsigned int background_ping:1;
-        unsigned int no_digest:1;
-        unsigned int default_parent:1;
-        unsigned int roundrobin:1;
-        unsigned int weighted_roundrobin:1;
-        unsigned int mcast_responder:1;
-        unsigned int closest_only:1;
-#if USE_HTCP
-        unsigned int htcp:1;
-        unsigned int htcp_oldsquid:1;
-        unsigned int htcp_no_clr:1;
-        unsigned int htcp_no_purge_clr:1;
-        unsigned int htcp_only_clr:1;
-        unsigned int htcp_forward_clr:1;
-#endif
-        unsigned int no_netdb_exchange:1;
-#if USE_DELAY_POOLS
-        unsigned int no_delay:1;
-#endif
-        unsigned int allow_miss:1;
-        unsigned int carp:1;
-        struct {
-            unsigned int set:1; //If false, whole url is to be used. Overrides others
-            unsigned int scheme:1;
-            unsigned int host:1;
-            unsigned int port:1;
-            unsigned int path:1;
-            unsigned int params:1;
-        } carp_key;
-#if USE_AUTH
-        unsigned int userhash:1;
-#endif
-        unsigned int sourcehash:1;
-        unsigned int originserver:1;
-        unsigned int no_tproxy:1;
-#if PEER_MULTICAST_SIBLINGS
-        unsigned int mcast_siblings:1;
-#endif
-    } options;
-
-    int weight;
-    int basetime;
-
-    struct {
-        double avg_n_members;
-        int n_times_counted;
-        int n_replies_expected;
-        int ttl;
-        int id;
-
-        struct {
-            unsigned int count_event_pending:1;
-            unsigned int counting:1;
-        } flags;
-    } mcast;
-#if USE_CACHE_DIGESTS
-
-    PeerDigest *digest;
-    char *digest_url;
-#endif
-
-    int tcp_up;                        /* 0 if a connect() fails */
-
-    Ip::Address addresses[10];
-    int n_addresses;
-    int rr_count;
-    peer *next;
-    int testing_now;
-
-    struct {
-        unsigned int hash;
-        double load_multiplier;
-        double load_factor;    /* normalized weight value */
-    } carp;
-#if USE_AUTH
-    struct {
-        unsigned int hash;
-        double load_multiplier;
-        double load_factor;    /* normalized weight value */
-    } userhash;
-#endif
-    struct {
-        unsigned int hash;
-        double load_multiplier;
-        double load_factor;    /* normalized weight value */
-    } sourcehash;
-
-    char *login;               /* Proxy authorization */
-    time_t connect_timeout;
-    int connect_fail_limit;
-    int max_conn;
-    char *domain;              /* Forced domain */
-#if USE_SSL
-
-    int use_ssl;
-    char *sslcert;
-    char *sslkey;
-    int sslversion;
-    char *ssloptions;
-    char *sslcipher;
-    char *sslcafile;
-    char *sslcapath;
-    char *sslcrlfile;
-    char *sslflags;
-    char *ssldomain;
-    SSL_CTX *sslContext;
-    SSL_SESSION *sslSession;
-#endif
-
-    int front_end_https;
-    int connection_auth;
-};
-
-struct _net_db_name {
-    hash_link hash;            /* must be first */
-    net_db_name *next;
-    netdbEntry *net_db_entry;
-};
-
-struct _net_db_peer {
-    const char *peername;
-    double hops;
-    double rtt;
-    time_t expires;
-};
-
-struct _netdbEntry {
-    hash_link hash;            /* must be first */
-    char network[MAX_IPSTRLEN];
-    int pings_sent;
-    int pings_recv;
-    double hops;
-    double rtt;
-    time_t next_ping_time;
-    time_t last_use_time;
-    int link_count;
-    net_db_name *hosts;
-    net_db_peer *peers;
-    int n_peers_alloc;
-    int n_peers;
-};
-
-struct _iostats {
-
-    enum { histSize = 16 };
-
-    struct {
-        int reads;
-        int reads_deferred;
-        int read_hist[histSize];
-        int writes;
-        int write_hist[histSize];
-    }
-
-    Http, Ftp, Gopher;
-};
-
-struct request_flags {
-    request_flags(): range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),fail_on_validation_err(0),stale_if_hit(0),accelerated(0),ignore_cc(0),intercepted(0),hostVerified(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),pinned(0),canRePin(0),chunked_reply(0),stream_error(0),sslPeek(0),sslBumped(0),destinationIPLookedUp_(0) {
-#if USE_HTTP_VIOLATIONS
-        nocache_hack = 0;
-#endif
-#if FOLLOW_X_FORWARDED_FOR
-        done_follow_x_forwarded_for = 0;
-#endif /* FOLLOW_X_FORWARDED_FOR */
-    }
-
-    unsigned int range:1;
-    unsigned int nocache:1;            ///< whether the response to this request may be READ from cache
-    unsigned int ims:1;
-    unsigned int auth:1;
-    unsigned int cachable:1;           ///< whether the response to thie request may be stored in the cache
-    unsigned int hierarchical:1;
-    unsigned int loopdetect:1;
-    unsigned int proxy_keepalive:1;
-unsigned int proxying:
-    1; /* this should be killed, also in httpstateflags */
-    unsigned int refresh:1;
-    unsigned int redirected:1;
-    unsigned int need_validation:1;
-    unsigned int fail_on_validation_err:1; ///< whether we should fail if validation fails
-    unsigned int stale_if_hit:1; ///< reply is stale if it is a hit
-#if USE_HTTP_VIOLATIONS
-    unsigned int nocache_hack:1;       /* for changing/ignoring no-cache requests */
-#endif
-    unsigned int accelerated:1;
-    unsigned int ignore_cc:1;
-    unsigned int intercepted:1;        ///< intercepted request
-    unsigned int hostVerified:1;       ///< whether the Host: header passed verification
-    unsigned int spoof_client_ip:1;  /**< spoof client ip if possible */
-    unsigned int internal:1;
-    unsigned int internalclient:1;
-    unsigned int must_keepalive:1;
-    unsigned int connection_auth:1; /** Request wants connection oriented auth */
-    unsigned int connection_auth_disabled:1; /** Connection oriented auth can not be supported */
-    unsigned int connection_proxy_auth:1; /** Request wants connection oriented auth */
-    unsigned int pinned:1;      /* Request sent on a pinned connection */
-    unsigned int canRePin:1; ///< OK to reopen a failed pinned connection
-    unsigned int auth_sent:1;   /* Authentication forwarded */
-    unsigned int no_direct:1;  /* Deny direct forwarding unless overriden by always_direct. Used in accelerator mode */
-    unsigned int chunked_reply:1; /**< Reply with chunked transfer encoding */
-    unsigned int stream_error:1; /**< Whether stream error has occured */
-    unsigned int sslPeek:1; ///< internal ssl-bump request to get server cert
-    unsigned int sslBumped:1; /**< ssl-bumped request*/
-
-    // When adding new flags, please update cloneAdaptationImmune() as needed.
-
-    bool resetTCP() const;
-    void setResetTCP();
-    void clearResetTCP();
-    void destinationIPLookupCompleted();
-    bool destinationIPLookedUp() const;
-
-    // returns a partial copy of the flags that includes only those flags
-    // that are safe for a related (e.g., ICAP-adapted) request to inherit
-    request_flags cloneAdaptationImmune() const;
-
-#if FOLLOW_X_FORWARDED_FOR
-    unsigned int done_follow_x_forwarded_for;
-#endif /* FOLLOW_X_FORWARDED_FOR */
-private:
-
-    unsigned int reset_tcp:1;
-    unsigned int destinationIPLookedUp_:1;
-};
-
-struct _cachemgr_passwd {
-    char *passwd;
-    wordlist *actions;
-    cachemgr_passwd *next;
-};
-
-struct _refresh_t {
-    const char *pattern;
-    regex_t compiled_pattern;
-    time_t min;
-    double pct;
-    time_t max;
-    refresh_t *next;
-
-    struct {
-        unsigned int icase:1;
-        unsigned int refresh_ims:1;
-        unsigned int store_stale:1;
-#if USE_HTTP_VIOLATIONS
-        unsigned int override_expire:1;
-        unsigned int override_lastmod:1;
-        unsigned int reload_into_ims:1;
-        unsigned int ignore_reload:1;
-        unsigned int ignore_no_cache:1;
-        unsigned int ignore_no_store:1;
-        unsigned int ignore_must_revalidate:1;
-        unsigned int ignore_private:1;
-        unsigned int ignore_auth:1;
-#endif
-    } flags;
-    int max_stale;
-};
-
-struct _CacheDigest {
-    /* public, read-only */
-    char *mask;                        /* bit mask */
-    int mask_size;             /* mask size in bytes */
-    int capacity;              /* expected maximum for .count, not a hard limit */
-    int bits_per_entry;                /* number of bits allocated for each entry from capacity */
-    int count;                 /* number of digested entries */
-    int del_count;             /* number of deletions performed so far */
-};
-
-struct _store_rebuild_data {
-    int objcount;              /* # objects successfully reloaded */
-    int expcount;              /* # objects expired */
-    int scancount;             /* # entries scanned or read from state file */
-    int clashcount;            /* # swapfile clashes avoided */
-    int dupcount;              /* # duplicates purged */
-    int cancelcount;           /* # SWAP_LOG_DEL objects purged */
-    int invalid;               /* # bad lines */
-    int badflags;              /* # bad e->flags */
-    int bad_log_op;
-    int zero_object_sz;
-};
-
-#if USE_SSL
-struct _sslproxy_cert_sign {
-    int alg;
-    ACLList *aclList;
-    sslproxy_cert_sign *next;
-};
-
-struct _sslproxy_cert_adapt {
-    int alg;
-    char *param;
-    ACLList *aclList;
-    sslproxy_cert_adapt *next;
-};
-#endif
-
-class Logfile;
-
-#include "format/Format.h"
-#include "log/Formats.h"
-struct _customlog {
-    char *filename;
-    ACLList *aclList;
-    Format::Format *logFormat;
-    Logfile *logfile;
-    customlog *next;
-    Log::Format::log_type type;
-};
-
 #endif /* SQUID_STRUCTS_H */
index cdb3d80c3ae8ec54a5d2fe76d55a9f549591c524..f46821d69ed58760cac4d51f99fabca18680f5f7 100644 (file)
  */
 
 #include "squid.h"
+#include "acl/Acl.h"
 #include "ConfigParser.h"
 #include "wordlist.h"
+#include "YesNoNone.h"
 
 #define STUB_API "cache_cf.cc"
 #include "tests/STUB.h"
index b2632fc0e9076dd9b699c3b365ae0be0eba0a330..1bb41ecb7ebbaffa8ceaf0ac9e670883a86bfd32 100644 (file)
@@ -1,6 +1,5 @@
 #include "squid.h"
 #include "base/AsyncJob.h"
-#include "structs.h"
 
 #define STUB_API "comm/libcomm.la"
 #include "tests/STUB.h"
@@ -17,8 +16,8 @@ Comm::Connection::Connection() STUB
 Comm::Connection::~Connection() STUB
 Comm::ConnectionPointer Comm::Connection::copyDetails() const STUB_RETVAL(NULL)
 void Comm::Connection::close() STUB
-peer * Comm::Connection::getPeer() const STUB_RETVAL(NULL)
-void Comm::Connection::setPeer(peer * p) STUB
+CachePeer * Comm::Connection::getPeer() const STUB_RETVAL(NULL)
+void Comm::Connection::setPeer(CachePeer * p) STUB
 
 #include "comm/ConnOpener.h"
 CBDATA_NAMESPACED_CLASS_INIT(Comm, ConnOpener);
index d5d539a17457a4d6f4e6b75d51c602352c84d323..974646889b7a3d99dcedee4c280723718e5b6245 100644 (file)
@@ -22,10 +22,10 @@ void netdbDump(StoreEntry *) STUB
 void netdbFreeMemory(void) STUB
 int netdbHostHops(const char *host) STUB_RETVAL(-1)
 int netdbHostRtt(const char *host) STUB_RETVAL(-1)
-void netdbUpdatePeer(HttpRequest *, peer * e, int rtt, int hops) STUB
+void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops) STUB
 void netdbDeleteAddrNetwork(Ip::Address &addr) STUB
 void netdbBinaryExchange(StoreEntry *) STUB
 void netdbExchangeStart(void *) STUB
-void netdbExchangeUpdatePeer(Ip::Address &, peer *, double, double) STUB
-peer *netdbClosestParent(HttpRequest *) STUB_RETVAL(NULL)
+void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double) STUB
+CachePeer *netdbClosestParent(HttpRequest *) STUB_RETVAL(NULL)
 void netdbHostData(const char *host, int *samp, int *rtt, int *hops) STUB
index 136debf5d88eb300f19818f1ac7b64a341af6b35..067ffc029c2c7c88003eb86e73eb77924f01b3e5 100644 (file)
@@ -1,4 +1,5 @@
 #include "squid.h"
+#include "RequestFlags.h"
 
 #define STUB_API "store.cc"
 #include "tests/STUB.h"
@@ -109,28 +110,28 @@ std::ostream &operator <<(std::ostream &os, const StoreEntry &)
     return os;
 }
 
-SQUIDCEXTERN size_t storeEntryInUse() STUB_RETVAL(0)
-SQUIDCEXTERN const char *storeEntryFlags(const StoreEntry *) STUB_RETVAL(NULL)
+size_t storeEntryInUse() STUB_RETVAL(0)
+const char *storeEntryFlags(const StoreEntry *) STUB_RETVAL(NULL)
 void storeEntryReplaceObject(StoreEntry *, HttpReply *) STUB
-SQUIDCEXTERN StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method) STUB_RETVAL(NULL)
-SQUIDCEXTERN StoreEntry *storeGetPublicByRequest(HttpRequest * request) STUB_RETVAL(NULL)
-SQUIDCEXTERN StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method) STUB_RETVAL(NULL)
-SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_flags, const HttpRequestMethod&) STUB_RETVAL(NULL)
-SQUIDCEXTERN void storeInit(void) STUB
-SQUIDCEXTERN void storeConfigure(void) STUB
-SQUIDCEXTERN void storeFreeMemory(void) STUB
-SQUIDCEXTERN int expiresMoreThan(time_t, time_t) STUB_RETVAL(0)
-SQUIDCEXTERN void storeAppendPrintf(StoreEntry *, const char *,...) STUB
+StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method) STUB_RETVAL(NULL)
+StoreEntry *storeGetPublicByRequest(HttpRequest * request) STUB_RETVAL(NULL)
+StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method) STUB_RETVAL(NULL)
+extern StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(NULL)
+void storeInit(void) STUB
+void storeConfigure(void) STUB
+void storeFreeMemory(void) STUB
+int expiresMoreThan(time_t, time_t) STUB_RETVAL(0)
+void storeAppendPrintf(StoreEntry *, const char *,...) STUB
 void storeAppendVPrintf(StoreEntry *, const char *, va_list ap) STUB
-SQUIDCEXTERN int storeTooManyDiskFilesOpen(void) STUB_RETVAL(0)
-SQUIDCEXTERN void storeHeapPositionUpdate(StoreEntry *, SwapDir *) STUB
-SQUIDCEXTERN void storeSwapFileNumberSet(StoreEntry * e, sfileno filn) STUB
-SQUIDCEXTERN void storeFsInit(void) STUB
-SQUIDCEXTERN void storeFsDone(void) STUB
-SQUIDCEXTERN void storeReplAdd(const char *, REMOVALPOLICYCREATE *) STUB
+int storeTooManyDiskFilesOpen(void) STUB_RETVAL(0)
+void storeHeapPositionUpdate(StoreEntry *, SwapDir *) STUB
+void storeSwapFileNumberSet(StoreEntry * e, sfileno filn) STUB
+void storeFsInit(void) STUB
+void storeFsDone(void) STUB
+void storeReplAdd(const char *, REMOVALPOLICYCREATE *) STUB
 void destroyStoreEntry(void *) STUB
-// in Packer.cc !? SQUIDCEXTERN void packerToStoreInit(Packer * p, StoreEntry * e) STUB
-SQUIDCEXTERN void storeGetMemSpace(int size) STUB
+// in Packer.cc !? void packerToStoreInit(Packer * p, StoreEntry * e) STUB
+void storeGetMemSpace(int size) STUB
 
 #if !_USE_INLINE_
 #include "Store.cci"
index 014b2aea65431b2646e46c6ead1e2ea428e8d216..8d952394744d39adc239eacee28a1b69a02854bc 100644 (file)
 
 #include "squid.h"
 #include "MemBuf.h"
+#include "store_rebuild.h"
 
 #define STUB_API "stub_store_rebuild.cc"
 #include "tests/STUB.h"
 
 void storeRebuildProgress(int sd_index, int total, int sofar) STUB
-void storeRebuildComplete(struct _store_rebuild_data *dc) STUB_NOP
-bool storeRebuildLoadEntry(int, int, MemBuf&, _store_rebuild_data&)
+void storeRebuildComplete(StoreRebuildData *dc) STUB_NOP
+bool storeRebuildLoadEntry(int, int, MemBuf&, StoreRebuildData&)
 {
     return false;
 }
-bool storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, struct _store_rebuild_data &counts) STUB_RETVAL(false)
-bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, struct _store_rebuild_data &, uint64_t) STUB_RETVAL(false)
+bool storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, StoreRebuildData &counts) STUB_RETVAL(false)
+bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, StoreRebuildData &, uint64_t) STUB_RETVAL(false)
index 5e5fc4aa2836db77b936c163a32105f801f19f78..d2cabb711f34157c3e6619e175fd71eb3248823e 100644 (file)
@@ -9,8 +9,10 @@
 #include "MemObject.h"
 #include "HttpHeader.h"
 #include "HttpReply.h"
+#include "RequestFlags.h"
 #include "StoreFileSystem.h"
 #include "testStoreSupport.h"
+#include "SquidConfig.h"
 
 #if HAVE_STDEXCEPT
 #include <stdexcept>
@@ -187,7 +189,7 @@ testCoss::testCossSearch()
     /* add an entry */
     {
         /* Create "vary" base object */
-        request_flags flags;
+        RequestFlags flags;
         flags.cachable = 1;
         StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
         HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
index 51c077a17c6da4b1aa180fa478e6529ea3990571..0d0ac4f956dd68bfa482f8bb886a7fcc13864f4d 100644 (file)
@@ -4,8 +4,10 @@
 #include <cppunit/TestAssert.h>
 
 #include "testEventLoop.h"
+#include "AsyncEngine.h"
 #include "EventLoop.h"
 #include "Mem.h"
+#include "SquidTime.h"
 #include "stat.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testEventLoop );
index 33ebc46a02516a009ff467f2d0c0502e1f8511ee..90b97dcb465c1376e4723fb4574e755e23a18338 100644 (file)
@@ -7,7 +7,7 @@
 #include "HttpParser.h"
 #include "Mem.h"
 #include "MemBuf.h"
-#include "structs.h"
+#include "SquidConfig.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testHttpParser );
 
index 3a819adb4f498ab95d6a368fe29a1d2bbade7f66..e393898de86059294c0add26a1b8cf9d2fa6358c 100644 (file)
@@ -7,10 +7,11 @@
 #include "HttpReply.h"
 #include "Mem.h"
 #include "mime_header.h"
+#include "SquidConfig.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testHttpReply );
 
-struct SquidConfig Config;
+class SquidConfig Config;
 
 /* stub functions to link successfully */
 
index 5f4ce2ab8f11d48aaa42f7190ab1fb4f8c54ef19..0e2bcf59d82eff7d25619f35855983699c1796b3 100644 (file)
@@ -9,6 +9,8 @@
 #include "MemObject.h"
 #include "HttpHeader.h"
 #include "HttpReply.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "StoreFileSystem.h"
 #include "testStoreSupport.h"
 
@@ -158,7 +160,7 @@ testNull::testNullSearch()
     /* add an entry */
     {
         /* Create "vary" base object */
-        request_flags flags;
+        RequestFlags flags;
         flags.cachable = 1;
         StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
         /* We are allowed to do this typecast */
index e403d3a7453a23838a599f77c09d5acb578b0222..c1d3ae5969ccc66115610f070e47fa0c849874d9 100644 (file)
@@ -8,6 +8,8 @@
 #include "HttpReply.h"
 #include "Mem.h"
 #include "MemObject.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "StoreFileSystem.h"
 #include "StoreSearch.h"
@@ -169,7 +171,7 @@ testRock::storeInit()
 StoreEntry *
 testRock::createEntry(const int i)
 {
-    request_flags flags;
+    RequestFlags flags;
     flags.cachable = 1;
     char url[64];
     snprintf(url, sizeof(url), "dummy url %i", i);
index a7d53229d19c854ca7cc37ff7e30577b7791aa6b..21e62cece9800005121764d5ab18c0c171c413c5 100644 (file)
@@ -6,6 +6,7 @@
 #include "SwapDir.h"
 #include "TestSwapDir.h"
 #include "Mem.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 #include "StoreSearch.h"
 
index daae502a04f0ec12c8f2e2a937cdd811504ad33d..9d320794f4f83f2f7c217f9f6027b63fe669d5be 100644 (file)
@@ -8,6 +8,7 @@
 #include "StoreHashIndex.h"
 #include "Mem.h"
 #include "StoreSearch.h"
+#include "SquidConfig.h"
 #include "SquidTime.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testStoreHashIndex );
index dfa6025c4fe7b6d3727d47a8993482ac87a40fc3..915ac92dfe4d7c8c5587acbb4cd1248514122a56 100644 (file)
@@ -35,6 +35,7 @@
 #define   SQUID_TESTSTORESUPPORT_H
 
 #include "EventLoop.h"
+#include "SquidTime.h"
 
 /* construct a stock loop with event dispatching, a time service that advances
  * 1 second a tick
index 8080bbd53110a5773ff1fc5413eac27c4098e1a0..1213414642fa884af162115a93f985a45daa2e73 100644 (file)
@@ -8,6 +8,8 @@
 #include "HttpReply.h"
 #include "Mem.h"
 #include "MemObject.h"
+#include "RequestFlags.h"
+#include "SquidConfig.h"
 #include "Store.h"
 #include "SwapDir.h"
 #include "testStoreSupport.h"
@@ -139,7 +141,7 @@ testUfs::testUfsSearch()
     /* add an entry */
     {
         /* Create "vary" base object */
-        request_flags flags;
+        RequestFlags flags;
         flags.cachable = 1;
         StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, METHOD_GET);
         HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
index 8c69c3570ed9a294ecca9d2695be349e2d622234..3676d0ad7e83f897d49c25f176e8a8a136007989 100644 (file)
@@ -42,6 +42,7 @@
 #include "ip/QosConfig.h"
 #include "MemBuf.h"
 #include "anyp/PortCfg.h"
+#include "SquidConfig.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 #include "ipc/Kids.h"
index 3effa13cbeb33c1c61f04d90cd3ded1ea8d841b8..2d7fe11e3150ea3a57b11adc53dee616768436f1 100644 (file)
@@ -41,66 +41,66 @@ class MemBuf;
 
 extern int DebugSignal;
 
-extern void kb_incr(kb_t *, size_t);
-extern void parseEtcHosts(void);
-extern int getMyPort(void);
-extern void setUmask(mode_t mask);
-extern void strwordquote(MemBuf * mb, const char *str);
+void kb_incr(kb_t *, size_t);
+void parseEtcHosts(void);
+int getMyPort(void);
+void setUmask(mode_t mask);
+void strwordquote(MemBuf * mb, const char *str);
 
 /* packs, then prints an object using debugs() */
-extern void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm);
+void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm);
 
-extern const char *getMyHostname(void);
-extern const char *uniqueHostname(void);
+const char *getMyHostname(void);
+const char *uniqueHostname(void);
 
-extern void death(int sig);
-extern void sigusr2_handle(int sig);
-extern void sig_child(int sig);
-extern void sig_shutdown(int sig); ///< handles shutdown notifications from kids
-extern void leave_suid(void);
-extern void enter_suid(void);
-extern void no_suid(void);
-extern void writePidFile(void);
-extern void setMaxFD(void);
-extern void setSystemLimits(void);
-extern void squid_signal(int sig, SIGHDLR *, int flags);
-extern pid_t readPidFile(void);
-extern void keepCapabilities(void);
-extern void BroadcastSignalIfAny(int& sig);
+void death(int sig);
+void sigusr2_handle(int sig);
+void sig_child(int sig);
+void sig_shutdown(int sig); ///< handles shutdown notifications from kids
+void leave_suid(void);
+void enter_suid(void);
+void no_suid(void);
+void writePidFile(void);
+void setMaxFD(void);
+void setSystemLimits(void);
+void squid_signal(int sig, SIGHDLR *, int flags);
+pid_t readPidFile(void);
+void keepCapabilities(void);
+void BroadcastSignalIfAny(int& sig);
 
 /// whether the current process is the parent of all other Squid processes
-extern bool IamMasterProcess();
+bool IamMasterProcess();
 /**
  *   whether the current process is dedicated to doing things that only
  *   a single process should do, such as PID file maintenance and WCCP
  */
-extern bool IamPrimaryProcess();
+bool IamPrimaryProcess();
 /// whether the current process coordinates worker processes
-extern bool IamCoordinatorProcess();
+bool IamCoordinatorProcess();
 /// whether the current process handles HTTP transactions and such
-extern bool IamWorkerProcess();
+bool IamWorkerProcess();
 /// whether the current process is dedicated to managing a cache_dir
-extern bool IamDiskProcess();
+bool IamDiskProcess();
 /// Whether we are running in daemon mode
-extern bool InDaemonMode(); // try using specific Iam*() checks above first
+bool InDaemonMode(); // try using specific Iam*() checks above first
 /// Whether there should be more than one worker process running
-extern bool UsingSmp(); // try using specific Iam*() checks above first
+bool UsingSmp(); // try using specific Iam*() checks above first
 /// number of Kid processes as defined in src/ipc/Kid.h
-extern int NumberOfKids();
+int NumberOfKids();
 /// a string describing this process roles such as worker or coordinator
-extern String ProcessRoles();
+String ProcessRoles();
 
-extern void debug_trap(const char *);
-extern void *xmemset(void *dst, int, size_t);
+void debug_trap(const char *);
+void *xmemset(void *dst, int, size_t);
 
-extern void logsFlush(void);
+void logsFlush(void);
 
-extern void squid_getrusage(struct rusage *r);
-extern double rusage_cputime(struct rusage *r);
-extern int rusage_maxrss(struct rusage *r);
-extern int rusage_pagefaults(struct rusage *r);
-extern void releaseServerSockets(void);
-extern void PrintRusage(void);
-extern void dumpMallocStats(void);
+void squid_getrusage(struct rusage *r);
+double rusage_cputime(struct rusage *r);
+int rusage_maxrss(struct rusage *r);
+int rusage_pagefaults(struct rusage *r);
+void releaseServerSockets(void);
+void PrintRusage(void);
+void dumpMallocStats(void);
 
 #endif /* SQUID_TOOLS_H_ */
index d42ebc898786d9a1cfdc1689948434bb6e767ba2..c5099fa4d571719b782c40b5d48f3bfc7a037f6e 100644 (file)
  */
 
 #include "squid.h"
-#include "errorpage.h"
-#include "HttpRequest.h"
-#include "fde.h"
+#include "acl/FilledChecklist.h"
 #include "Array.h"
+#include "CachePeer.h"
+#include "client_side_request.h"
+#include "client_side.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
 #include "comm/Write.h"
-#include "client_side_request.h"
-#include "acl/FilledChecklist.h"
-#include "client_side.h"
-#include "MemBuf.h"
+#include "errorpage.h"
+#include "fde.h"
 #include "http.h"
+#include "HttpRequest.h"
+#include "HttpStateFlags.h"
+#include "MemBuf.h"
 #include "PeerSelectState.h"
+#include "SquidConfig.h"
 #include "StatCounters.h"
 #include "tools.h"
-
 #if USE_DELAY_POOLS
 #include "DelayId.h"
 #endif
@@ -530,7 +532,7 @@ tunnelConnected(const Comm::ConnectionPointer &server, void *data)
     TunnelStateData *tunnelState = (TunnelStateData *)data;
     debugs(26, 3, HERE << server << ", tunnelState=" << tunnelState);
 
-    if (tunnelState->request && (tunnelState->request->flags.spoof_client_ip || tunnelState->request->flags.intercepted))
+    if (tunnelState->request && (tunnelState->request->flags.spoofClientIp || tunnelState->request->flags.intercepted))
         tunnelStartShoveling(tunnelState); // ssl-bumped connection, be quiet
     else {
         AsyncCall::Pointer call = commCbCall(5,5, "tunnelConnectedWriteDone",
@@ -691,7 +693,7 @@ tunnelRelayConnectRequest(const Comm::ConnectionPointer &srv, void *data)
     TunnelStateData *tunnelState = (TunnelStateData *)data;
     HttpHeader hdr_out(hoRequest);
     Packer p;
-    http_state_flags flags;
+    HttpStateFlags flags;
     debugs(26, 3, HERE << srv << ", tunnelState=" << tunnelState);
     memset(&flags, '\0', sizeof(flags));
     flags.proxying = tunnelState->request->flags.proxying;
index 8a935961418358609794b6cb537ac12184ad9ac8..488671adbc55d8c5865337c259c9f9c7e5ceddcb 100644 (file)
@@ -45,60 +45,12 @@ typedef struct {
     size_t kb;
 } kb_t;
 
-typedef struct _close_handler close_handler;
-
-typedef struct _dread_ctrl dread_ctrl;
-
-typedef struct _dwrite_q dwrite_q;
-
-typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs;
-
-typedef struct _domain_ping domain_ping;
-
-typedef struct _domain_type domain_type;
-
-typedef struct _DigestFetchState DigestFetchState;
-
-typedef struct _net_db_name net_db_name;
-
-typedef struct _net_db_peer net_db_peer;
-
-typedef struct _netdbEntry netdbEntry;
-
-typedef struct _icp_common_t icp_common_t;
-
-typedef struct _iostats iostats;
-
-typedef struct _http_state_flags http_state_flags;
-
-typedef struct _header_mangler header_mangler;
-
-typedef struct _cachemgr_passwd cachemgr_passwd;
-
-typedef struct _refresh_t refresh_t;
-
 typedef struct _CommWriteStateData CommWriteStateData;
 
-typedef struct _storeSwapLogData storeSwapLogData;
-
-typedef struct _CacheDigest CacheDigest;
-
-typedef struct _Version Version;
-
-typedef struct _customlog customlog;
-
-#if USE_SSL
-typedef struct _sslproxy_cert_sign sslproxy_cert_sign;
-
-typedef struct _sslproxy_cert_adapt sslproxy_cert_adapt;
-#endif
-
 #if SQUID_SNMP
 #include "snmp_vars.h"
 #include "cache_snmp.h"
 typedef variable_list *(oid_ParseFn) (variable_list *, snint *);
-
-typedef struct _snmp_request_t snmp_request_t;
 #endif
 
 typedef void FREE(void *);
@@ -120,7 +72,8 @@ typedef void FQDNH(const char *, const DnsLookupDetails &details, void *);
 typedef void IDCB(const char *ident, void *data);
 
 #include "anyp/ProtocolType.h"
-typedef void IRCB(struct peer *, peer_t, AnyP::ProtocolType, void *, void *data);
+class CachePeer;
+typedef void IRCB(CachePeer *, peer_t, AnyP::ProtocolType, void *, void *data);
 
 typedef void RH(void *data, char *);
 /* in wordlist.h */
index e417a7a0fac2addc40fb4e4652d860259976a894..2363c93f2f89fd555e50a7bfe04445b672b6f72b 100644 (file)
  */
 
 #if USE_UNLINKD
-extern bool unlinkdNeeded(void);
-extern void unlinkdInit(void);
-extern void unlinkdClose(void);
-extern void unlinkdUnlink(const char *);
+bool unlinkdNeeded(void);
+void unlinkdInit(void);
+void unlinkdClose(void);
+void unlinkdUnlink(const char *);
 #else /* USE_UNLINKD */
 
 #if HAVE_UNISTD_H
index e701f2cc40e5b63f4cf88684dacb21a620d90e4f..5377b1f48254cc3ddb7a912409702e140be1d0f5 100644 (file)
@@ -35,6 +35,7 @@
 #include "globals.h"
 #include "HttpRequest.h"
 #include "rfc1738.h"
+#include "SquidConfig.h"
 #include "SquidString.h"
 #include "URL.h"
 #include "URLScheme.h"
index ab64ff7df3ee8b22b6b8c56dc5ed1b99a51f8fea..0fbdd137097fa991f88a1c656cac4970133c462e 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * DEBUG: section 52    URN Parsing
  * AUTHOR: Kostas Anagnostakis
@@ -40,6 +39,7 @@
 #include "icmp/net_db.h"
 #include "MemBuf.h"
 #include "mime_header.h"
+#include "RequestFlags.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "StoreClient.h"
@@ -256,7 +256,7 @@ UrnState::created(StoreEntry *newEntry)
     urlres_e = newEntry;
 
     if (urlres_e->isNull()) {
-        urlres_e = storeCreateEntry(urlres, urlres, request_flags(), METHOD_GET);
+        urlres_e = storeCreateEntry(urlres, urlres, RequestFlags(), METHOD_GET);
         sc = storeClientListAdd(urlres_e, this);
         FwdState::fwdStart(Comm::ConnectionPointer(), urlres_e, urlres_r);
     } else {
index 217ac62fc83ebabca9ad521d7dccb023c5dcb6fa..f44bd070b360ac382410354b43119d8af8221428 100644 (file)
--- a/src/urn.h
+++ b/src/urn.h
@@ -1,6 +1,6 @@
 /*
- * DEBUG: section
- * AUTHOR:
+ * DEBUG: section 52    URN Parsing
+ * AUTHOR: Kostas Anagnostakis
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -36,6 +36,6 @@
 class HttpRequest;
 class StoreEntry;
 
-extern void urnStart(HttpRequest *, StoreEntry *);
+void urnStart(HttpRequest *, StoreEntry *);
 
 #endif /* SQUID_URN_H_ */
index 78308fcb61186608358837a0fcfe497585fd2b6a..b43cdb4e574e0bac8a9193ba98725d592745c1dc 100644 (file)
@@ -37,7 +37,7 @@
 #include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "event.h"
-#include "structs.h"
+#include "SquidConfig.h"
 
 #define WCCP_PORT 2048
 #define WCCP_REVISION 0
index 3d03bf46d548af886c56600b717b0b9c035dc9de..0ace72cd8d90fe4a67de38933a1c1ac089062a8b 100644 (file)
@@ -34,9 +34,9 @@
 #define SQUID_WCCP_H_
 
 #if USE_WCCP
-extern void wccpInit(void);
-extern void wccpConnectionOpen(void);
-extern void wccpConnectionClose(void);
+void wccpInit(void);
+void wccpConnectionOpen(void);
+void wccpConnectionClose(void);
 #endif /* USE_WCCP */
 
 #endif /* SQUID_WCCP_H_ */
index 532903c4d9473350dbf823beab7fe376653c72b8..6c93846e23f8b64df9bb577d75a15ab78726b29e 100644 (file)
 
 class StoreEntry;
 
-extern void wccp2Init(void);
-extern void wccp2ConnectionOpen(void);
-extern void wccp2ConnectionClose(void);
-extern void parse_wccp2_method(int *v);
-extern void free_wccp2_method(int *v);
-extern void dump_wccp2_method(StoreEntry * e, const char *label, int v);
-extern void parse_wccp2_amethod(int *v);
-extern void free_wccp2_amethod(int *v);
-extern void dump_wccp2_amethod(StoreEntry * e, const char *label, int v);
+void wccp2Init(void);
+void wccp2ConnectionOpen(void);
+void wccp2ConnectionClose(void);
+void parse_wccp2_method(int *v);
+void free_wccp2_method(int *v);
+void dump_wccp2_method(StoreEntry * e, const char *label, int v);
+void parse_wccp2_amethod(int *v);
+void free_wccp2_amethod(int *v);
+void dump_wccp2_amethod(StoreEntry * e, const char *label, int v);
 
-extern void parse_wccp2_service(void *v);
-extern void free_wccp2_service(void *v);
-extern void dump_wccp2_service(StoreEntry * e, const char *label, void *v);
+void parse_wccp2_service(void *v);
+void free_wccp2_service(void *v);
+void dump_wccp2_service(StoreEntry * e, const char *label, void *v);
 
-extern int check_null_wccp2_service(void *v);
+int check_null_wccp2_service(void *v);
 
-extern void parse_wccp2_service_info(void *v);
+void parse_wccp2_service_info(void *v);
 
-extern void free_wccp2_service_info(void *v);
+void free_wccp2_service_info(void *v);
 
-extern void dump_wccp2_service_info(StoreEntry * e, const char *label, void *v);
+void dump_wccp2_service_info(StoreEntry * e, const char *label, void *v);
 #endif /* USE_WCCPv2 */
 
 #endif /* WCCP2_H_ */
index 445ddfa216f7b2893f449c2383cae7b081260494..35bde794f9759ca379a7309de583c2e414e8c3c3 100644 (file)
@@ -39,6 +39,7 @@
 #include "HttpRequest.h"
 #include "HttpRequest.h"
 #include "forward.h"
+#include "SquidConfig.h"
 #include "StatCounters.h"
 #include "Store.h"
 #include "tools.h"
index a73aa56acc98881976d6dbcbb71ff4454ddb78c3..a558506f777d55220dc009d406722b53dbe3c181 100644 (file)
@@ -39,6 +39,6 @@
  */
 
 /// \ingroup ServerProtocolWhoisAPI
-extern void whoisStart(FwdState *);
+void whoisStart(FwdState *);
 
 #endif /* SQUID_WHOIS_H_ */
index 569d1e2fa2df5b60f49201f2a992293b8f5b0fa1..5834dba61e2a8c04d0235de97bd0e7fe4991eb4b 100644 (file)
 #include <sys/types.h>
 #endif
 
-extern int WIN32_pipe(int[2]);
+int WIN32_pipe(int[2]);
 
-extern int WIN32_getrusage(int, struct rusage *);
-extern void WIN32_ExceptionHandlerInit(void);
+int WIN32_getrusage(int, struct rusage *);
+void WIN32_ExceptionHandlerInit(void);
 
-extern int Win32__WSAFDIsSet(int fd, fd_set* set);
-extern DWORD WIN32_IpAddrChangeMonitorInit();
+int Win32__WSAFDIsSet(int fd, fd_set* set);
+DWORD WIN32_IpAddrChangeMonitorInit();
 
 #endif
 
index 31a0536e412001c4274cfd61125ae4a9638a2757..13b3c09fcd6ae143769738807638e361a1fbfb5a 100644 (file)
@@ -45,11 +45,13 @@ public:
 
 MEMPROXY_CLASS_INLINE(wordlist);
 
-extern const char *wordlistAdd(wordlist **, const char *);
-extern void wordlistCat(const wordlist *, MemBuf * mb);
-extern void wordlistAddWl(wordlist **, wordlist *);
-extern void wordlistJoin(wordlist **, wordlist **);
-extern wordlist *wordlistDup(const wordlist *);
-extern void wordlistDestroy(wordlist **);
+class MemBuf;
+
+const char *wordlistAdd(wordlist **, const char *);
+void wordlistCat(const wordlist *, MemBuf * mb);
+void wordlistAddWl(wordlist **, wordlist *);
+void wordlistJoin(wordlist **, wordlist **);
+wordlist *wordlistDup(const wordlist *);
+void wordlistDestroy(wordlist **);
 
 #endif /* SQUID_WORDLIST_H */