From: Guido Serassio Date: Thu, 1 May 2008 15:59:41 +0000 (+0200) Subject: Import reconfigure cachemgr action from NT Devel branch X-Git-Tag: SQUID_3_1_0_1~49^2~266 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=757a22916ad199209348b7a2da1acf15229afa6b;p=thirdparty%2Fsquid.git Import reconfigure cachemgr action from NT Devel branch This patch add the reconfigure restricted action to Cache Manager. --- diff --git a/src/cache_manager.cc b/src/cache_manager.cc index 9ebabf9c7a..00f5b38e9a 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -67,6 +67,7 @@ static void cachemgrStateFree(cachemgrStateData * mgr); static char *cachemgrPasswdGet(cachemgr_passwd *, const char *); static const char *cachemgrActionProtection(const CacheManagerAction * at); static OBJH cachemgrShutdown; +static OBJH cachemgrReconfigure; static OBJH cachemgrMenu; static OBJH cachemgrOfflineToggle; @@ -79,6 +80,9 @@ CacheManager::CacheManager() registerAction("shutdown", "Shut Down the Squid Process", cachemgrShutdown, 1, 1); + registerAction("reconfigure", + "Reconfigure the Squid Process", + cachemgrReconfigure, 1, 1); registerAction("offline_toggle", "Toggle offline_mode setting", cachemgrOfflineToggle, 1, 1); @@ -359,6 +363,15 @@ cachemgrShutdown(StoreEntry * entryunused) shut_down(0); } +/// \ingroup CacheManagerInternal +static void +cachemgrReconfigure(StoreEntry * sentry) +{ + debug(16, 0) ("Reconfigure by command.\n"); + storeAppendPrintf(sentry, "Reconfiguring Squid Process ...."); + reconfigure(SIGHUP); +} + /// \ingroup CacheManagerInternal static void cachemgrOfflineToggle(StoreEntry * sentry) diff --git a/src/tests/testCacheManager.cc b/src/tests/testCacheManager.cc index 02b165a618..a66a54f564 100644 --- a/src/tests/testCacheManager.cc +++ b/src/tests/testCacheManager.cc @@ -13,6 +13,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init memory pools */ diff --git a/src/tests/testEvent.cc b/src/tests/testEvent.cc index f004abd559..9826963c17 100644 --- a/src/tests/testEvent.cc +++ b/src/tests/testEvent.cc @@ -18,6 +18,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init legacy static-initialized modules */ diff --git a/src/tests/testEventLoop.cc b/src/tests/testEventLoop.cc index dc16ab8889..dc57f9a14e 100644 --- a/src/tests/testEventLoop.cc +++ b/src/tests/testEventLoop.cc @@ -21,6 +21,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init legacy static-initialized modules */ diff --git a/src/tests/testHttpRequest.cc b/src/tests/testHttpRequest.cc index db225ffa49..4d160573b6 100644 --- a/src/tests/testHttpRequest.cc +++ b/src/tests/testHttpRequest.cc @@ -16,6 +16,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init memory pools */ diff --git a/src/tests/testURL.cc b/src/tests/testURL.cc index 7b25efa070..598d6321d0 100644 --- a/src/tests/testURL.cc +++ b/src/tests/testURL.cc @@ -16,6 +16,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init memory pools */ diff --git a/src/tests/test_http_range.cc b/src/tests/test_http_range.cc index e4a969ef84..8ca76bd579 100644 --- a/src/tests/test_http_range.cc +++ b/src/tests/test_http_range.cc @@ -53,6 +53,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + SQUIDCEXTERN void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str) { fatal ("dummy function\n"); diff --git a/src/ufsdump.cc b/src/ufsdump.cc index 9e0d0abcd6..f648a82186 100644 --- a/src/ufsdump.cc +++ b/src/ufsdump.cc @@ -48,6 +48,10 @@ void shut_down(int) {} +void +reconfigure(int) +{} + #if WHENITMINIMAL void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)