From: Amos Jeffries Date: Thu, 25 Sep 2014 06:50:32 +0000 (-0700) Subject: SourceLayout: shuffle HelperChildConfig into libhelper.la X-Git-Tag: SQUID_3_5_0_1~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76d9b9943781cbf76c7e299ac8c758e67db012a6;p=thirdparty%2Fsquid.git SourceLayout: shuffle HelperChildConfig into libhelper.la --- diff --git a/src/Makefile.am b/src/Makefile.am index a7021cf012..98358b4cc6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -373,8 +373,6 @@ squid_SOURCES = \ gopher.cc \ helper.cc \ helper.h \ - HelperChildConfig.h \ - HelperChildConfig.cc \ hier_code.h \ HierarchyLogEntry.h \ $(HTCPSOURCE) \ @@ -745,7 +743,7 @@ ufsdump_SOURCES = \ ufsdump.cc \ dlink.h \ dlink.cc \ - HelperChildConfig.h \ + helper/ChildConfig.h \ tests/stub_HelperChildConfig.cc \ HttpRequestMethod.cc \ RemovalPolicy.cc \ @@ -1245,8 +1243,6 @@ tests_testACLMaxUserIP_SOURCES= \ tests/stub_fatal.cc \ FileMap.h \ filemap.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ HttpBody.cc \ HttpHeader.h \ HttpHeader.cc \ @@ -1348,6 +1344,7 @@ tests_testACLMaxUserIP_SOURCES= \ nodist_tests_testACLMaxUserIP_SOURCES= \ $(TESTSOURCES) tests_testACLMaxUserIP_LDADD= \ + helper/libhelper.la \ http/libsquid-http.la \ $(AUTH_ACL_LIBS) \ ident/libident.la \ @@ -1474,8 +1471,6 @@ tests_testCacheManager_SOURCES = \ gopher.cc \ hier_code.h \ helper.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ $(HTCPSOURCE) \ HttpStateFlags.h \ http.cc \ @@ -1892,8 +1887,6 @@ tests_testEvent_SOURCES = \ gopher.h \ gopher.cc \ helper.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ hier_code.h \ $(HTCPSOURCE) \ http.cc \ @@ -2142,8 +2135,6 @@ tests_testEventLoop_SOURCES = \ gopher.h \ gopher.cc \ helper.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ hier_code.h \ $(HTCPSOURCE) \ http.cc \ @@ -2388,8 +2379,6 @@ tests_test_http_range_SOURCES = \ gopher.h \ gopher.cc \ helper.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ hier_code.h \ $(HTCPSOURCE) \ http.cc \ @@ -2696,8 +2685,6 @@ tests_testHttpRequest_SOURCES = \ gopher.h \ gopher.cc \ helper.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ hier_code.h \ $(HTCPSOURCE) \ http.cc \ @@ -3516,8 +3503,6 @@ tests_testURL_SOURCES = \ gopher.h \ gopher.cc \ helper.cc \ - HelperChildConfig.h \ - HelperChildConfig.cc \ hier_code.h \ $(HTCPSOURCE) \ http.cc \ diff --git a/src/SquidConfig.h b/src/SquidConfig.h index 9b5c87fdea..f69c336cc4 100644 --- a/src/SquidConfig.h +++ b/src/SquidConfig.h @@ -13,7 +13,7 @@ #include "base/RefCount.h" #include "ClientDelayConfig.h" #include "DelayConfig.h" -#include "HelperChildConfig.h" +#include "helper/ChildConfig.h" #include "HttpHeaderTools.h" #include "icmp/IcmpConfig.h" #include "ip/Address.h" @@ -184,8 +184,8 @@ public: } Program; - HelperChildConfig redirectChildren; - HelperChildConfig storeIdChildren; + Helper::ChildConfig redirectChildren; + Helper::ChildConfig storeIdChildren; time_t authenticateGCInterval; time_t authenticateTTL; time_t authenticateIpTTL; diff --git a/src/auth/Config.h b/src/auth/Config.h index d20e83cd8a..28795d1afd 100644 --- a/src/auth/Config.h +++ b/src/auth/Config.h @@ -13,7 +13,7 @@ #include "AccessLogEntry.h" #include "auth/UserRequest.h" -#include "HelperChildConfig.h" +#include "helper/ChildConfig.h" class StoreEntry; class HttpReply; @@ -124,7 +124,7 @@ public: virtual const char * type() const = 0; public: - HelperChildConfig authenticateChildren; + Helper::ChildConfig authenticateChildren; wordlist *authenticateProgram; ///< Helper program to run, includes all parameters String keyExtrasLine; ///< The format of the request to the auth helper Format::Format *keyExtras; ///< The compiled request format diff --git a/src/external_acl.cc b/src/external_acl.cc index cde7ba7916..43be055ec0 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -90,7 +90,7 @@ public: wordlist *cmdline; - HelperChildConfig children; + Helper::ChildConfig children; helper *theHelper; diff --git a/src/helper.h b/src/helper.h index 1cbbcc7268..16c24a0b68 100644 --- a/src/helper.h +++ b/src/helper.h @@ -16,8 +16,8 @@ #include "cbdata.h" #include "comm/forward.h" #include "dlink.h" +#include "helper/ChildConfig.h" #include "helper/forward.h" -#include "HelperChildConfig.h" #include "ip/Address.h" class helper @@ -39,7 +39,7 @@ public: dlink_list servers; dlink_list queue; const char *id_name; - HelperChildConfig childs; ///< Configuration settings for number running. + Helper::ChildConfig childs; ///< Configuration settings for number running. int ipc_type; Ip::Address addr; time_t last_queue_warn; diff --git a/src/HelperChildConfig.cc b/src/helper/ChildConfig.cc similarity index 91% rename from src/HelperChildConfig.cc rename to src/helper/ChildConfig.cc index 1a0e41a0d3..c929aabd0c 100644 --- a/src/HelperChildConfig.cc +++ b/src/helper/ChildConfig.cc @@ -11,12 +11,12 @@ #include "ConfigParser.h" #include "Debug.h" #include "globals.h" -#include "HelperChildConfig.h" +#include "helper/ChildConfig.h" #include "Parsing.h" #include -HelperChildConfig::HelperChildConfig(const unsigned int m): +Helper::ChildConfig::ChildConfig(const unsigned int m): n_max(m), n_startup(0), n_idle(1), @@ -25,8 +25,8 @@ HelperChildConfig::HelperChildConfig(const unsigned int m): n_active(0) {} -HelperChildConfig & -HelperChildConfig::updateLimits(const HelperChildConfig &rhs) +Helper::ChildConfig & +Helper::ChildConfig::updateLimits(const Helper::ChildConfig &rhs) { // Copy the limits only. // Preserve the local state values (n_running and n_active) @@ -38,7 +38,7 @@ HelperChildConfig::updateLimits(const HelperChildConfig &rhs) } int -HelperChildConfig::needNew() const +Helper::ChildConfig::needNew() const { /* during the startup and reconfigure use our special amount... */ if (starting_up || reconfiguring) return n_startup; @@ -51,7 +51,7 @@ HelperChildConfig::needNew() const } void -HelperChildConfig::parseConfig() +Helper::ChildConfig::parseConfig() { char const *token = ConfigParser::NextToken(); diff --git a/src/HelperChildConfig.h b/src/helper/ChildConfig.h similarity index 90% rename from src/HelperChildConfig.h rename to src/helper/ChildConfig.h index 24bbe95dda..aa68e65798 100644 --- a/src/HelperChildConfig.h +++ b/src/helper/ChildConfig.h @@ -6,8 +6,11 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef _SQUID_SRC_HELPERCHILDCONFIG_H -#define _SQUID_SRC_HELPERCHILDCONFIG_H +#ifndef _SQUID_SRC_HELPER_CHILDCONFIG_H +#define _SQUID_SRC_HELPER_CHILDCONFIG_H + +namespace Helper +{ /** * Contains statistics of a particular type of child helper. @@ -15,10 +18,10 @@ * Some derived from a helper children configuration option, * some from runtime stats on the currently active children. */ -class HelperChildConfig +class ChildConfig { public: - explicit HelperChildConfig(const unsigned int m = 0); + explicit ChildConfig(const unsigned int m = 0); /** * When new helpers are needed call this to find out how many more @@ -35,7 +38,7 @@ public: * This is for parsing new child settings into an object incrementally then updating * the running set without loosing any of the active state or causing races. */ - HelperChildConfig &updateLimits(const HelperChildConfig &rhs); + ChildConfig &updateLimits(const ChildConfig &rhs); /* values from squid.conf */ public: @@ -82,9 +85,11 @@ public: unsigned int n_active; }; +} // namespace Helper + /* Legacy parser interface */ #define parse_HelperChildConfig(c) (c)->parseConfig() #define dump_HelperChildConfig(e,n,c) storeAppendPrintf((e), "\n%s %d startup=%d idle=%d concurrency=%d\n", (n), (c).n_max, (c).n_startup, (c).n_idle, (c).concurrency) #define free_HelperChildConfig(dummy) // NO. -#endif /* _SQUID_SRC_HELPERCHILDCONFIG_H */ +#endif /* _SQUID_SRC_HELPER_CHILDCONFIG_H */ diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index fa7a57c08e..fa1dbf165a 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -11,6 +11,8 @@ include $(top_srcdir)/src/TestHeaders.am noinst_LTLIBRARIES = libhelper.la libhelper_la_SOURCES = \ + ChildConfig.cc \ + ChildConfig.h \ forward.h \ Reply.cc \ Reply.h \ diff --git a/src/ssl/Config.h b/src/ssl/Config.h index a1cd70a604..a64cf8cd27 100644 --- a/src/ssl/Config.h +++ b/src/ssl/Config.h @@ -9,7 +9,7 @@ #ifndef SQUID_SSL_CONFIG_H #define SQUID_SSL_CONFIG_H -#include "HelperChildConfig.h" +#include "helper/ChildConfig.h" namespace Ssl { @@ -20,10 +20,10 @@ public: #if USE_SSL_CRTD char *ssl_crtd; ///< Name of external ssl_crtd application. /// The number of processes spawn for ssl_crtd. - HelperChildConfig ssl_crtdChildren; + ::Helper::ChildConfig ssl_crtdChildren; #endif char *ssl_crt_validator; - HelperChildConfig ssl_crt_validator_Children; + ::Helper::ChildConfig ssl_crt_validator_Children; Config(); ~Config(); private: diff --git a/src/tests/stub_HelperChildConfig.cc b/src/tests/stub_HelperChildConfig.cc index d2473030b4..2d9e80854c 100644 --- a/src/tests/stub_HelperChildConfig.cc +++ b/src/tests/stub_HelperChildConfig.cc @@ -8,14 +8,14 @@ #include "squid.h" #include "globals.h" -#include "HelperChildConfig.h" +#include "helper/ChildConfig.h" #define STUB_API "stub_HelperChildconfig.cc" #include "tests/STUB.h" #include -HelperChildConfig::HelperChildConfig(const unsigned int m): +Helper::ChildConfig::ChildConfig(const unsigned int m): n_max(m), n_startup(0), n_idle(1), @@ -25,7 +25,7 @@ HelperChildConfig::HelperChildConfig(const unsigned int m): {} int -HelperChildConfig::needNew() const +Helper::ChildConfig::needNew() const { /* during the startup and reconfigure use our special amount... */ if (starting_up || reconfiguring) return n_startup; @@ -37,4 +37,4 @@ HelperChildConfig::needNew() const return (n_max - n_active); } -void HelperChildConfig::parseConfig() STUB +void Helper::ChildConfig::parseConfig() STUB