------------------------------------------------------------ revno: 8768 revision-id: amosjeffries@squid-cache.org-20080503044851-28hcwmte26n7prxs parent: amosjeffries@squid-cache.org-20080503044644-t5vsjwt2g6audnae committer: Amos Jeffries branch nick: SQUID_3_0 timestamp: Fri 2008-05-02 22:48:51 -0600 message: Author: Guido Serassio Import reconfigure cachemgr action from NT Devel branch This patch add the reconfigure restricted action to Cache Manager. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: amosjeffries@squid-cache.org-20080503044851-\ # 28hcwmte26n7prxs # target_branch: http://www.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_0/ # testament_sha1: bbb79959cc0c839591f03c714a73fc03e3803365 # timestamp: 2008-05-03 04:51:02 +0000 # source_branch: http://www.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_0 # base_revision_id: amosjeffries@squid-cache.org-20080503044644-\ # t5vsjwt2g6audnae # # Begin patch === modified file 'src/cache_manager.cc' --- src/cache_manager.cc 2007-10-31 10:52:15 +0000 +++ src/cache_manager.cc 2008-05-03 04:48:51 +0000 @@ -63,6 +63,7 @@ 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 @@ 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); @@ -349,6 +353,15 @@ } 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) { Config.onoff.offline = !Config.onoff.offline; === modified file 'src/tests/testCacheManager.cc' --- src/tests/testCacheManager.cc 2007-05-29 19:31:36 +0000 +++ src/tests/testCacheManager.cc 2008-05-03 04:48:51 +0000 @@ -13,6 +13,10 @@ shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init memory pools */ === modified file 'src/tests/testEvent.cc' --- src/tests/testEvent.cc 2007-08-27 18:50:42 +0000 +++ src/tests/testEvent.cc 2008-05-03 04:48:51 +0000 @@ -15,6 +15,10 @@ shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init legacy static-initialized modules */ === modified file 'src/tests/testEventLoop.cc' --- src/tests/testEventLoop.cc 2007-05-24 02:59:14 +0000 +++ src/tests/testEventLoop.cc 2008-05-03 04:48:51 +0000 @@ -16,6 +16,10 @@ shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init legacy static-initialized modules */ === modified file 'src/tests/testHttpRequest.cc' --- src/tests/testHttpRequest.cc 2007-05-29 19:31:36 +0000 +++ src/tests/testHttpRequest.cc 2008-05-03 04:48:51 +0000 @@ -13,6 +13,10 @@ shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init memory pools */ === modified file 'src/tests/testURL.cc' --- src/tests/testURL.cc 2007-05-24 02:59:14 +0000 +++ src/tests/testURL.cc 2008-05-03 04:48:51 +0000 @@ -14,6 +14,10 @@ shut_down(int) {} +void +reconfigure(int) +{} + /* end stubs */ /* init memory pools */ === modified file 'src/tests/test_http_range.cc' --- src/tests/test_http_range.cc 2007-05-29 19:31:36 +0000 +++ src/tests/test_http_range.cc 2008-05-03 04:48:51 +0000 @@ -45,6 +45,10 @@ shut_down(int) {} +void +reconfigure(int) +{} + SQUIDCEXTERN void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str) { fatal ("dummy function\n"); === modified file 'src/ufsdump.cc' --- src/ufsdump.cc 2007-11-15 23:47:31 +0000 +++ src/ufsdump.cc 2008-05-03 04:48:51 +0000 @@ -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)