From: Amos Jeffries Date: Sat, 3 May 2008 04:48:51 +0000 (-0600) Subject: Author: Guido Serassio X-Git-Tag: SQUID_3_0_STABLE6~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d615efa4c6c5d37aad6e1a889e0b36191143639a;p=thirdparty%2Fsquid.git Author: Guido Serassio 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 f8b07f7d45..74aeea1c5f 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -63,6 +63,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; @@ -74,6 +75,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); @@ -348,6 +352,15 @@ cachemgrShutdown(StoreEntry * entryunused) shut_down(0); } +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 d91db9fb32..6e880de1e2 100644 --- a/src/tests/testEvent.cc +++ b/src/tests/testEvent.cc @@ -15,6 +15,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 edbfd81c5d..22baf84040 100644 --- a/src/tests/testEventLoop.cc +++ b/src/tests/testEventLoop.cc @@ -16,6 +16,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 d0840cca6a..ada78952ee 100644 --- a/src/tests/testHttpRequest.cc +++ b/src/tests/testHttpRequest.cc @@ -13,6 +13,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 031161bdef..839df9103a 100644 --- a/src/tests/testURL.cc +++ b/src/tests/testURL.cc @@ -14,6 +14,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 2f52f12ae8..ee0e7711fb 100644 --- a/src/tests/test_http_range.cc +++ b/src/tests/test_http_range.cc @@ -45,6 +45,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)