From f795b3737143d4905d9ab86d15833318af2ffb8c Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Mon, 20 Aug 2012 13:50:25 +0200 Subject: [PATCH] Moved peer sourcehash functions to peer_sourcehash.h --- src/Makefile.am | 7 +++++++ src/main.cc | 1 + src/peer_select.cc | 1 + src/peer_sourcehash.h | 45 +++++++++++++++++++++++++++++++++++++++++++ src/protos.h | 3 --- 5 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 src/peer_sourcehash.h diff --git a/src/Makefile.am b/src/Makefile.am index d9b2f6bd24..c66f76bd3f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -420,6 +420,7 @@ squid_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ PeerSelectState.h \ @@ -1386,6 +1387,7 @@ tests_testCacheManager_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ redirect.cc \ @@ -1733,6 +1735,7 @@ tests_testEvent_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ redirect.cc \ @@ -1935,6 +1938,7 @@ tests_testEventLoop_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ RemovalPolicy.cc \ @@ -2132,6 +2136,7 @@ tests_test_http_range_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ pconn.cc \ @@ -2371,6 +2376,7 @@ tests_testHttpRequest_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ redirect.cc \ @@ -3316,6 +3322,7 @@ tests_testURL_SOURCES = \ peer_digest.cc \ peer_proxy_negotiate_auth.cc \ peer_select.cc \ + peer_sourcehash.h \ peer_sourcehash.cc \ peer_userhash.cc \ redirect.cc \ diff --git a/src/main.cc b/src/main.cc index 109bc37fe8..14226062e6 100644 --- a/src/main.cc +++ b/src/main.cc @@ -68,6 +68,7 @@ #include "neighbors.h" #include "pconn.h" #include "PeerSelectState.h" +#include "peer_sourcehash.h" #include "profiler/Profiler.h" #include "protos.h" #include "refresh.h" diff --git a/src/peer_select.cc b/src/peer_select.cc index 4d8b5b8765..bb6f23118d 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -46,6 +46,7 @@ #include "ICP.h" #include "ipcache.h" #include "neighbors.h" +#include "peer_sourcehash.h" #include "PeerSelectState.h" #include "protos.h" #include "SquidTime.h" diff --git a/src/peer_sourcehash.h b/src/peer_sourcehash.h new file mode 100644 index 0000000000..bbfd87247e --- /dev/null +++ b/src/peer_sourcehash.h @@ -0,0 +1,45 @@ +/* + * 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. + * + */ + + +#ifndef SQUID_PEER_SOURCEHASH_H_ +#define SQUID_PEER_SOURCEHASH_H_ + +class peer; +class HttpRequest; + +extern void peerSourceHashInit(void); +extern peer * peerSourceHashSelectParent(HttpRequest * request); + + + +#endif /* SQUID_PEER_SOURCEHASH_H_ */ diff --git a/src/protos.h b/src/protos.h index b196a9779d..7283e2bc07 100644 --- a/src/protos.h +++ b/src/protos.h @@ -475,9 +475,6 @@ SQUIDCEXTERN peer *carpSelectParent(HttpRequest *); SQUIDCEXTERN void peerUserHashInit(void); SQUIDCEXTERN peer * peerUserHashSelectParent(HttpRequest * request); -SQUIDCEXTERN void peerSourceHashInit(void); -SQUIDCEXTERN peer * peerSourceHashSelectParent(HttpRequest * request); - /* * prototypes for system functions missing from system includes */ -- 2.47.3