]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved Cache Digest functions to CacheDigest.h
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 19 Aug 2012 21:32:32 +0000 (23:32 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 19 Aug 2012 21:32:32 +0000 (23:32 +0200)
src/CacheDigest.cc
src/CacheDigest.h [new file with mode: 0644]
src/Makefile.am
src/neighbors.cc
src/peer_digest.cc
src/protos.h
src/stat.cc
src/store.cc
src/store_digest.cc
src/test_cache_digest.cc

index 47b6788d7e21c66790f95f35bc531805992093a2..420b3a471614b233d66143dc32ea2a597c2b69b2 100644 (file)
@@ -41,6 +41,9 @@
 
 #if USE_CACHE_DIGESTS
 
+#include "CacheDigest.h"
+#include "structs.h"
+
 /* local types */
 
 typedef struct {
diff --git a/src/CacheDigest.h b/src/CacheDigest.h
new file mode 100644 (file)
index 0000000..b9f1304
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * DEBUG: section 70    Cache Digest
+ * AUTHOR: Alex Rousskov
+ *
+ * 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.
+ * 
+ */
+
+#ifndef SQUID_CACHEDIGEST_H_
+#define SQUID_CACHEDIGEST_H_
+
+#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);
+
+
+#endif /* SQUID_CACHEDIGEST_H_ */
index 3236db25cf93579b7d9000e6d30d65a59e272e97..bce5b68773fbfad192518dfa4a30a43404ebef16 100644 (file)
@@ -264,6 +264,7 @@ squid_SOURCES = \
        AsyncEngine.cc \
        AsyncEngine.h \
        cache_cf.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        cache_manager.cc \
        CacheManager.h \
@@ -1302,6 +1303,7 @@ tests_testCacheManager_SOURCES = \
        BodyPipe.cc \
        cache_manager.cc \
        cache_cf.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        carp.cc \
        cbdata.cc \
@@ -1480,6 +1482,7 @@ tests_testCacheManager_DEPENDENCIES = \
        $(SQUID_CPPUNIT_LA)
 
 tests_testDiskIO_SOURCES = \
+       CacheDigest.h \
        CacheDigest.cc \
        cbdata.cc \
        client_db.h \
@@ -1634,6 +1637,7 @@ tests_testEvent_SOURCES = \
        AccessLogEntry.cc \
        $(ACL_REGISTRATION_SOURCES) \
        BodyPipe.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        cache_cf.cc \
        cache_manager.cc \
@@ -1834,6 +1838,7 @@ tests_testEventLoop_SOURCES = \
        AccessLogEntry.cc \
        $(ACL_REGISTRATION_SOURCES) \
        BodyPipe.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        cache_manager.cc \
        cache_cf.cc \
@@ -2034,6 +2039,7 @@ tests_test_http_range_SOURCES = \
        BodyPipe.cc \
        cache_cf.cc \
        cache_manager.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        carp.cc \
        cbdata.cc \
@@ -2281,6 +2287,7 @@ tests_testHttpRequest_SOURCES = \
        cache_manager.cc \
        cache_cf.cc \
        debug.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        carp.cc \
        cbdata.cc \
@@ -2454,6 +2461,7 @@ tests_testHttpRequest_DEPENDENCIES = \
 ## why so many sources? well httpHeaderTools requites ACLChecklist & friends.
 ## first line - what we are testing.
 tests_testStore_SOURCES= \
+       CacheDigest.h \
        CacheDigest.cc \
        cbdata.cc \
        ClientInfo.h \
@@ -2696,6 +2704,7 @@ tests_testUfs_SOURCES = \
        $(WIN32_SOURCE) \
        event.cc \
        $(DELAY_POOL_SOURCE) \
+       CacheDigest.h \
        CacheDigest.cc \
        ConfigParser.cc \
        EventLoop.cc \
@@ -2799,6 +2808,7 @@ tests_testUfs_DEPENDENCIES = \
 
 tests_testRock_SOURCES = \
        cbdata.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        ConfigOption.cc \
        ConfigParser.cc \
@@ -2971,6 +2981,7 @@ tests_testCoss_SOURCES = \
        $(WIN32_SOURCE) \
        event.cc \
        $(DELAY_POOL_SOURCE) \
+       CacheDigest.h \
        CacheDigest.cc \
        ConfigParser.cc \
        EventLoop.cc \
@@ -3107,6 +3118,7 @@ tests_testNull_SOURCES = \
        $(WIN32_SOURCE) \
        event.cc \
        $(DELAY_POOL_SOURCE) \
+       CacheDigest.h \
        CacheDigest.cc \
        ConfigParser.cc \
        EventLoop.cc \
@@ -3206,6 +3218,7 @@ tests_testURL_SOURCES = \
        BodyPipe.cc \
        cache_cf.cc \
        cache_manager.cc \
+       CacheDigest.h \
        CacheDigest.cc \
        carp.cc \
        cbdata.cc \
index 9f64003c7e021245ab0d5fd44e5651ecfd3b6e22..7a27933301844cd54de7627f5c02bf88898d12dc 100644 (file)
@@ -33,6 +33,7 @@
 #include "squid.h"
 #include "acl/FilledChecklist.h"
 #include "anyp/PortCfg.h"
+#include "CacheDigest.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
 #include "event.h"
index b66000e96d032ef7897dbec1149fbb90129b477b..6319f74a1e4d7d8ee595b1ceaf945435c36bd50c 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "squid.h"
 #if USE_CACHE_DIGESTS
+#include "CacheDigest.h"
 #include "event.h"
 #include "forward.h"
 #include "HttpReply.h"
index 1263abfdad9bf3a9f43cb0ea8204ec0a9bfe5af0..b56e64e3cfa21b12ea18f829d23a276ae08f2ba1 100644 (file)
@@ -468,22 +468,6 @@ SQUIDCEXTERN pid_t ipcCreate(int type,
                              int *wfd,
                              void **hIpc);
 
-class CacheDigestGuessStats;
-/* CacheDigest */
-SQUIDCEXTERN CacheDigest *cacheDigestCreate(int capacity, int bpe);
-SQUIDCEXTERN void cacheDigestDestroy(CacheDigest * cd);
-SQUIDCEXTERN CacheDigest *cacheDigestClone(const CacheDigest * cd);
-SQUIDCEXTERN void cacheDigestClear(CacheDigest * cd);
-SQUIDCEXTERN void cacheDigestChangeCap(CacheDigest * cd, int new_cap);
-SQUIDCEXTERN int cacheDigestTest(const CacheDigest * cd, const cache_key * key);
-SQUIDCEXTERN void cacheDigestAdd(CacheDigest * cd, const cache_key * key);
-SQUIDCEXTERN void cacheDigestDel(CacheDigest * cd, const cache_key * key);
-SQUIDCEXTERN size_t cacheDigestCalcMaskSize(int cap, int bpe);
-SQUIDCEXTERN int cacheDigestBitUtil(const CacheDigest * cd);
-SQUIDCEXTERN void cacheDigestGuessStatsUpdate(CacheDigestGuessStats * stats, int real_hit, int guess_hit);
-SQUIDCEXTERN void cacheDigestGuessStatsReport(const CacheDigestGuessStats * stats, StoreEntry * sentry, const char *label);
-SQUIDCEXTERN void cacheDigestReport(CacheDigest * cd, const char *label, StoreEntry * e);
-
 SQUIDCEXTERN void internalStart(const Comm::ConnectionPointer &clientConn, HttpRequest *, StoreEntry *);
 SQUIDCEXTERN int internalCheck(const char *urlpath);
 SQUIDCEXTERN int internalStaticCheck(const char *urlpath);
index 9614495acf9dc1355de9b13cc4ca612b8fd04e94..1ce9875b904b31aa1fb439a768cf38c24a0c38e1 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "squid.h"
+#include "CacheDigest.h"
 #include "client_side_request.h"
 #include "client_side.h"
 #include "comm/Connection.h"
index fdbead6f35fcca4d06f87822ed3b1c2e8f706d8f..77d4e3f2c6b9e5c27c6e583f31476cf309c73c07 100644 (file)
@@ -34,6 +34,7 @@
  */
 
 #include "squid.h"
+#include "CacheDigest.h"
 #include "CacheManager.h"
 #include "comm/Connection.h"
 #include "ETag.h"
index 6f2efc0259857a42cea771b8c341f4e1b91712f7..d2ff1eeb22ba13ab6d94dc394453e08779ef9d65 100644 (file)
@@ -46,8 +46,9 @@
 #include "globals.h"
 #include "mgr/Registration.h"
 #include "protos.h"
-#if USE_CACHE_DIGESTS
 
+#if USE_CACHE_DIGESTS
+#include "CacheDigest.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
 #include "MemObject.h"
index 017ef0db598fd6d37898ded96515c911f93214fe..31109e3dc4e217a9ca4a74bc599766c20cfadb63 100644 (file)
@@ -37,6 +37,7 @@
  */
 
 #include "squid.h"
+#include "CacheDigest.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>