From: serassio <> Date: Mon, 31 Jul 2006 19:17:57 +0000 (+0000) Subject: wccp2_rebuild_wait directive to delay registering with WCCP until the X-Git-Tag: SQUID_3_0_PRE5~203 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f67332d360ee05603a6d8e92d4401ba83d4804b0;p=thirdparty%2Fsquid.git wccp2_rebuild_wait directive to delay registering with WCCP until the store rebuild have finished. By Steven Wilton --- diff --git a/src/cf.data.pre b/src/cf.data.pre index abd65b43c8..b098abb02e 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/structs.h b/src/structs.h index f7994d7024..e4ed04e37b 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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; } diff --git a/src/wccp2.cc b/src/wccp2.cc index ee9cf0933e..dec8c374a3 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -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