From: Francesco Chemolli Date: Fri, 4 Jul 2008 17:07:03 +0000 (+0200) Subject: Turned reconfigure into command object X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e678300ed94207a91b694540fecfff9d466c6ee5;p=thirdparty%2Fsquid.git Turned reconfigure into command object --- diff --git a/src/CacheManager.h b/src/CacheManager.h index b590f7a07a..c829232a17 100644 --- a/src/CacheManager.h +++ b/src/CacheManager.h @@ -75,6 +75,13 @@ public: CacheManagerShutdownAction(); }; +class CacheManagerReconfigureAction : public CacheManagerAction { +public: + virtual void run (StoreEntry *sentry); + CacheManagerReconfigureAction(); +}; + + class CacheManagerActionList : public Vector { }; diff --git a/src/cache_manager.cc b/src/cache_manager.cc index 55d98b6846..73e8c89422 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -61,13 +61,11 @@ CacheManager::CacheManager() delete(ActionsList); //TODO: Laaazy. Will be moved to class member ActionsList = new CacheManagerActionList; registerAction("menu", "This Cachemanager Menu", MenuCommand, 0, 1); - registerAction("reconfigure", - "Reconfigure the Squid Process", - ReconfigureCommand, 1, 1); registerAction("offline_toggle", "Toggle offline_mode setting", OfflineToggleCommand, 1, 1); registerAction(new CacheManagerShutdownAction); + registerAction(new CacheManagerReconfigureAction); } void @@ -344,14 +342,14 @@ void CacheManagerShutdownAction::run(StoreEntry *sentry) } CacheManagerShutdownAction::CacheManagerShutdownAction() : CacheManagerAction("shutdown","Shut Down the Squid Process", 1, 1) { } -/// \ingroup CacheManagerInternal void -CacheManager::ReconfigureCommand(StoreEntry * sentry) +CacheManagerReconfigureAction::run(StoreEntry * sentry) { debug(16, 0) ("Reconfigure by command.\n"); storeAppendPrintf(sentry, "Reconfiguring Squid Process ...."); reconfigure(SIGHUP); } +CacheManagerReconfigureAction::CacheManagerReconfigureAction() : CacheManagerAction("reconfigure","Reconfigure Squid", 1, 1) { } /// \ingroup CacheManagerInternal void