From e678300ed94207a91b694540fecfff9d466c6ee5 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Fri, 4 Jul 2008 19:07:03 +0200 Subject: [PATCH] Turned reconfigure into command object --- src/CacheManager.h | 7 +++++++ src/cache_manager.cc | 8 +++----- 2 files changed, 10 insertions(+), 5 deletions(-) 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 -- 2.47.3