]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Turned reconfigure into command object
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 4 Jul 2008 17:07:03 +0000 (19:07 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 4 Jul 2008 17:07:03 +0000 (19:07 +0200)
src/CacheManager.h
src/cache_manager.cc

index b590f7a07a64367905d230a6c926af645af5e8db..c829232a17dcb9a381fd471f2a9a309842cbc3f1 100644 (file)
@@ -75,6 +75,13 @@ public:
      CacheManagerShutdownAction();
 };
 
+class CacheManagerReconfigureAction : public CacheManagerAction {
+public:
+     virtual void run (StoreEntry *sentry);
+     CacheManagerReconfigureAction();
+};
+
+
 class CacheManagerActionList : public Vector<CacheManagerAction *> {
 };
 
index 55d98b6846c443fe901be8d5bf73e7c958d88db3..73e8c89422833c810d59f77a1b030b4133d62412 100644 (file)
@@ -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