From: Francesco Chemolli Date: Fri, 31 Aug 2012 16:28:10 +0000 (+0200) Subject: Moved Auth::Init to new specific header file.i X-Git-Tag: sourceformat-review-1~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=897368610b29ea99a16731f296286798e211ffee;p=thirdparty%2Fsquid.git Moved Auth::Init to new specific header file.i --- diff --git a/src/AuthReg.cc b/src/AuthReg.cc index 3cde989372..86d59df5f2 100644 --- a/src/AuthReg.cc +++ b/src/AuthReg.cc @@ -1,6 +1,7 @@ #include "squid.h" #if USE_AUTH +#include "AuthReg.h" #if HAVE_AUTH_MODULE_BASIC #include "auth/basic/Scheme.h" diff --git a/src/AuthReg.h b/src/AuthReg.h new file mode 100644 index 0000000000..4662eba5cc --- /dev/null +++ b/src/AuthReg.h @@ -0,0 +1,45 @@ +#ifndef SQUID_AUTHREG_H_ +#define SQUID_AUTHREG_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. + * + */ + +namespace Auth { + +#if USE_AUTH + /// Initialize Auth subsystem + extern void Init(void); +#else /* USE_AUTH */ + inline void Init(void) {} /* NOP if not USE_AUTH */ +#endif /* USE_AUTH */ + +} // namespace Auth +#endif /* SQUID_AUTHREG_H_ */ diff --git a/src/Makefile.am b/src/Makefile.am index 7b9c23a62f..e1633b0a21 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -265,6 +265,7 @@ squid_SOURCES = \ AsyncEngine.cc \ AsyncEngine.h \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ CacheDigest.h \ CacheDigest.cc \ @@ -1361,6 +1362,7 @@ tests_testCacheManager_SOURCES = \ BodyPipe.cc \ cache_manager.cc \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ CacheDigest.h \ CacheDigest.cc \ @@ -1743,6 +1745,7 @@ tests_testEvent_SOURCES = \ CacheDigest.h \ CacheDigest.cc \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ cache_manager.cc \ carp.h \ @@ -1975,6 +1978,7 @@ tests_testEventLoop_SOURCES = \ CacheDigest.cc \ cache_manager.cc \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ carp.h \ carp.cc \ @@ -2202,6 +2206,7 @@ tests_test_http_range_SOURCES = \ $(ACL_REGISTRATION_SOURCES) \ BodyPipe.cc \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ cache_manager.cc \ CacheDigest.h \ @@ -2484,6 +2489,7 @@ tests_testHttpRequest_SOURCES = \ BodyPipe.cc \ cache_manager.cc \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ debug.cc \ CacheDigest.h \ @@ -3521,6 +3527,7 @@ tests_testURL_SOURCES = \ $(ACL_REGISTRATION_SOURCES) \ BodyPipe.cc \ cache_cf.h \ + AuthReg.h \ cache_cf.cc \ cache_manager.cc \ CacheDigest.h \ diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 96c650fbb1..1c74ca2dbd 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -37,6 +37,7 @@ #include "acl/Gadgets.h" #include "acl/MethodData.h" #include "anyp/PortCfg.h" +#include "AuthReg.h" #include "base/RunnersRegistry.h" #include "cache_cf.h" #include "ConfigParser.h" diff --git a/src/main.cc b/src/main.cc index 824105acc1..e15d9137ae 100644 --- a/src/main.cc +++ b/src/main.cc @@ -34,6 +34,7 @@ #include "AccessLogEntry.h" #include "acl/Acl.h" #include "acl/Asn.h" +#include "AuthReg.h" #include "base/RunnersRegistry.h" #include "base/Subscription.h" #include "base/TextException.h" @@ -1385,9 +1386,7 @@ SquidMain(int argc, char **argv) /* we may want the parsing process to set this up in the future */ Store::Root(new StoreController); -#if USE_AUTH - Auth::Init(); /* required for config parsing */ -#endif + Auth::Init(); /* required for config parsing. NOP if !USE_AUTH */ Ip::ProbeTransport(); // determine IPv4 or IPv6 capabilities before parsing. Format::Token::Init(); // XXX: temporary. Use a runners registry of pre-parse runners instead. diff --git a/src/protos.h b/src/protos.h index 4163dc4bdf..476f528fc8 100644 --- a/src/protos.h +++ b/src/protos.h @@ -71,14 +71,5 @@ extern void reconfigure(int); #endif -#if USE_AUTH - - - namespace Auth { - /* call to ensure the auth component schemes exist. */ - extern void Init(void); - } // namespace Auth - -#endif /* USE_AUTH */ #endif /* SQUID_PROTOS_H */