]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
wccp2_rebuild_wait directive to delay registering with WCCP until the
authorserassio <>
Mon, 31 Jul 2006 19:17:57 +0000 (19:17 +0000)
committerserassio <>
Mon, 31 Jul 2006 19:17:57 +0000 (19:17 +0000)
store rebuild have finished.

By Steven Wilton

src/cf.data.pre
src/structs.h
src/wccp2.cc

index abd65b43c81e5da388682195e425eb8a59149ea5..b098abb02e40c4b5b5bc6f37c7caa66d7f4d2f16 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.419 2006/07/02 16:53:46 serassio Exp $
+# $Id: cf.data.pre,v 1.420 2006/07/31 13:17:57 serassio Exp $
 #
 #
 # SQUID Web Proxy Cache                http://www.squid-cache.org/
@@ -4041,6 +4041,16 @@ DOC_START
        do not specify this parameter.
 DOC_END
 
+NAME: wccp2_rebuild_wait
+TYPE: onoff
+LOC: Config.Wccp2.rebuildwait
+DEFAULT: on
+IFDEF: USE_WCCPv2
+DOC_START
+       If this is enabled Squid will wait for the cache dir rebuild to finish
+       before sending the first wccp2 HereIAm packet
+DOC_END
+
 NAME: wccp2_forwarding_method
 TYPE: int
 LOC: Config.Wccp2.forwarding_method
index f7994d70249847912e8261f183866a69bdfd73a4..e4ed04e37b8d64c45624570e6e404521c3adc1e9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.544 2006/07/02 16:53:47 serassio Exp $
+ * $Id: structs.h,v 1.545 2006/07/31 13:17:57 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -327,6 +327,7 @@ struct _SquidConfig
         struct IN_ADDR address;
         int forwarding_method;
         int return_method;
+        int rebuildwait;
         void *info;
     }
 
index ee9cf0933e73fec2b3d70c711ef27d1afff6c388..dec8c374a3c82182aae5daec4a47365373372327 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wccp2.cc,v 1.2 2006/07/29 19:25:57 serassio Exp $
+ * $Id: wccp2.cc,v 1.3 2006/07/31 13:17:57 serassio Exp $
  *
  * DEBUG: section 80    WCCP Support
  * AUTHOR: Steven WIlton
@@ -1344,6 +1344,12 @@ wccp2HereIam(void *voidnotused)
         return;
     }
 
+    /* Wait 10 seconds if store dirs are rebuilding */
+    if (store_dirs_rebuilding && Config.Wccp2.rebuildwait) {
+        eventAdd("wccp2HereIam", wccp2HereIam, NULL, 1.0, 1);
+        return;
+    }
+
     router_len = sizeof(router);
     memset(&router, '\0', router_len);
     router.sin_family = AF_INET;
@@ -1386,8 +1392,7 @@ wccp2HereIam(void *voidnotused)
         service_list_ptr = service_list_ptr->next;
     }
 
-    if (!eventFind(wccp2HereIam, NULL))
-        eventAdd("wccp2HereIam", wccp2HereIam, NULL, 10.0, 1);
+    eventAdd("wccp2HereIam", wccp2HereIam, NULL, 10.0, 1);
 }
 
 static void