]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Import reconfigure cachemgr action from NT Devel branch
authorGuido Serassio <serassio@squid-cache.org>
Thu, 1 May 2008 15:59:41 +0000 (17:59 +0200)
committerGuido Serassio <serassio@squid-cache.org>
Thu, 1 May 2008 15:59:41 +0000 (17:59 +0200)
This patch add the reconfigure restricted action to Cache Manager.

src/cache_manager.cc
src/tests/testCacheManager.cc
src/tests/testEvent.cc
src/tests/testEventLoop.cc
src/tests/testHttpRequest.cc
src/tests/testURL.cc
src/tests/test_http_range.cc
src/ufsdump.cc

index 9ebabf9c7a8fad8bb9d9e69782ea1b681893be98..00f5b38e9afa34311617f5464ec8529f48876886 100644 (file)
@@ -67,6 +67,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;
 
@@ -79,6 +80,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);
@@ -359,6 +363,15 @@ cachemgrShutdown(StoreEntry * entryunused)
     shut_down(0);
 }
 
+/// \ingroup CacheManagerInternal
+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)
index 02b165a61835a60810256c1f4341a6b98e932b9c..a66a54f564c2157c40dc242393fafa7a6e95a9c4 100644 (file)
@@ -13,6 +13,10 @@ void
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init memory pools */
index f004abd55971de83b4accd0b49be2f5af75b05bc..9826963c171043424d382a7219c53a61eae7d03f 100644 (file)
@@ -18,6 +18,10 @@ void
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init legacy static-initialized modules */
index dc16ab888961c1fea97f602d92d99cdb1493a86a..dc57f9a14e0001b512d2584f35a2bec50ed71691 100644 (file)
@@ -21,6 +21,10 @@ void
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init legacy static-initialized modules */
index db225ffa4918e88be31e340e330fadcd2d66a8b1..4d160573b6020efbac2cc9f937b6ed7ca4e74971 100644 (file)
@@ -16,6 +16,10 @@ void
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init memory pools */
index 7b25efa0707b1f6ab70a7c8085fa7b0ef3bbd9ba..598d6321d0ebac134b23f407b0362e5ec03e483a 100644 (file)
@@ -16,6 +16,10 @@ void
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init memory pools */
index e4a969ef84e7fc12a27a04823e68b273809a80ad..8ca76bd579b443f4110b8aaa319bd54de994ff38 100644 (file)
@@ -53,6 +53,10 @@ void
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 SQUIDCEXTERN void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str)
 {
     fatal ("dummy function\n");
index 9e0d0abcd6ddad32f02f433993d0ac46e556ecf8..f648a82186bb8a8675efa890fc5f5eeaf8ecc5ef 100644 (file)
 void shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 #if WHENITMINIMAL
 void
 eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)