[master] 411edd8 Reduce #include pollution by cache.h

Poul-Henning Kamp phk at FreeBSD.org
Thu Sep 28 07:58:07 UTC 2017


commit 411edd87478f40bad6d2cdc9f2d3a3de2666067c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Sep 28 07:55:59 2017 +0000

    Reduce #include pollution by cache.h
    
    varnishd sources now use cache_priv.h as primary #include, and that
    includes cache.h, rather than the other way around.

diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index 84c1df2..598ada1 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -147,7 +147,6 @@ pkgdatadir = ${datarootdir}/${PACKAGE}/vcl
 varnishd_CFLAGS = \
 	@PCRE_CFLAGS@ \
 	@SAN_CFLAGS@ \
-	-DVARNISHD_IS_NOT_A_VMOD \
 	-DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' \
 	-DVARNISH_VMOD_DIR='"${pkglibdir}/vmods"' \
 	-DVARNISH_VCL_DIR='"${pkgsysconfdir}:${pkgdatadir}"'
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 3bcc3ae..3c34417 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -34,29 +34,20 @@
  */
 #define VARNISH_CACHE_CHILD	1
 
+#include <math.h>
+#include <pthread.h>
 #include <stdarg.h>
 #include <stdint.h>
-
 #include <sys/types.h>
 
+#include "vdef.h"
+
 #include "miniobj.h"
 #include "vas.h"
-#include "vdef.h"
 #include "vqueue.h"
-#include "vsb.h"
 
 #include "vapi/vsl_int.h"
 
-#include <sys/socket.h>
-
-#include <pthread.h>
-#include <string.h>
-#include <limits.h>
-#include <unistd.h>
-#include <math.h>
-
-#include "common/common_param.h"
-
 /*--------------------------------------------------------------------*/
 
 enum req_fsm_nxt {
@@ -1074,7 +1065,3 @@ Tlen(const txt t)
 			    "MAGIC 0x%08x (Should:%s/0x%08x)\n",	\
 			    (ptr)->magic, #exp, exp);			\
 	} while(0)
-
-#ifdef VARNISHD_IS_NOT_A_VMOD
-#  include "cache/cache_priv.h"
-#endif
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index a5131a0..22b42ab 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -33,7 +33,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <errno.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 35f1cdb..20568b6 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -34,7 +34,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vrt.h"
 #include "vtcp.h"
diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index 22d10c4..7d72e18 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -36,7 +36,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vcli_serve.h"
 #include "vrt.h"
diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index c1935dd..307513a 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "binary_heap.h"
 #include "vcli_serve.h"
diff --git a/bin/varnishd/cache/cache_backend_tcp.c b/bin/varnishd/cache/cache_backend_tcp.c
index b13a4aa..dc10d5d 100644
--- a/bin/varnishd/cache/cache_backend_tcp.c
+++ b/bin/varnishd/cache/cache_backend_tcp.c
@@ -36,7 +36,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vrt.h"
 #include "vsa.h"
diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index 43f89b2..96254f2 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -32,7 +32,7 @@
 
 #include <pcre.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_ban.h"
 
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/cache/cache_ban_build.c b/bin/varnishd/cache/cache_ban_build.c
index c98baa6..ab0f685 100644
--- a/bin/varnishd/cache/cache_ban_build.c
+++ b/bin/varnishd/cache/cache_ban_build.c
@@ -32,7 +32,7 @@
 
 #include <pcre.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_ban.h"
 
 #include "vend.h"
diff --git a/bin/varnishd/cache/cache_ban_lurker.c b/bin/varnishd/cache/cache_ban_lurker.c
index ad1bd12..dfc9981 100644
--- a/bin/varnishd/cache/cache_ban_lurker.c
+++ b/bin/varnishd/cache/cache_ban_lurker.c
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_ban.h"
 
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 521c6ac..043aca7 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -35,7 +35,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "hash/hash_slinger.h"
 
diff --git a/bin/varnishd/cache/cache_cli.c b/bin/varnishd/cache/cache_cli.c
index e7e5001..b9d82da 100644
--- a/bin/varnishd/cache/cache_cli.c
+++ b/bin/varnishd/cache/cache_cli.c
@@ -36,7 +36,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "common/heritage.h"
 
 #include "vcli_serve.h"
diff --git a/bin/varnishd/cache/cache_deliver_proc.c b/bin/varnishd/cache/cache_deliver_proc.c
index c1b079e..e0d9496 100644
--- a/bin/varnishd/cache/cache_deliver_proc.c
+++ b/bin/varnishd/cache/cache_deliver_proc.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_filter.h"
 
 /* VDP_bytes
diff --git a/bin/varnishd/cache/cache_director.c b/bin/varnishd/cache/cache_director.c
index 3b2df2c..6f9a6a2 100644
--- a/bin/varnishd/cache/cache_director.c
+++ b/bin/varnishd/cache/cache_director.c
@@ -35,7 +35,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "cache_director.h"
 
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index d9ec496..6818fa2 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <stdlib.h>
 
diff --git a/bin/varnishd/cache/cache_esi_fetch.c b/bin/varnishd/cache/cache_esi_fetch.c
index 3b909e4..a6799b6 100644
--- a/bin/varnishd/cache/cache_esi_fetch.c
+++ b/bin/varnishd/cache/cache_esi_fetch.c
@@ -33,7 +33,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_filter.h"
 #include "cache_vgz.h"
 
diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index 6866767..771bf80 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "cache_vgz.h"
 #include "cache_esi.h"
diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index f0ca523..19324f7 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -34,7 +34,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "binary_heap.h"
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index cf2605b..2898a9d 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_director.h"
 #include "cache_filter.h"
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index fcc4924..4773b97 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -31,7 +31,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_filter.h"
 #include "vcli_serve.h"
 
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index a085511..a933101 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -40,7 +40,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_filter.h"
 #include "cache_vgz.h"
 #include "vend.h"
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 2e9baf9..3d83bee 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -52,7 +52,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index e1b9117..70b7c1a 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -32,7 +32,7 @@
 #include "config.h"
 
 #include <stddef.h>
-#include "cache.h"
+#include "cache_priv.h"
 #include <stdio.h>
 
 #include "vend.h"
diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c
index 52cec50..5837957 100644
--- a/bin/varnishd/cache/cache_lck.c
+++ b/bin/varnishd/cache/cache_lck.c
@@ -35,7 +35,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <errno.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index cd95431..e3edb72 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/cache/cache_mempool.c b/bin/varnishd/cache/cache_mempool.c
index 160d1da..6f60d72 100644
--- a/bin/varnishd/cache/cache_mempool.c
+++ b/bin/varnishd/cache/cache_mempool.c
@@ -31,7 +31,7 @@
 #include "config.h"
 
 #include <stddef.h>
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c
index a139bcf..b5c30c0 100644
--- a/bin/varnishd/cache/cache_obj.c
+++ b/bin/varnishd/cache/cache_obj.c
@@ -83,7 +83,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_obj.h"
 #include "vend.h"
 #include "storage/storage.h"
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 5e1b8b6..44b84a2 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -38,7 +38,7 @@
 #include "vtim.h"
 #include "vcs.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_transport.h"
 
 #include "cache_filter.h"
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index e25b3a0..aa47190 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -37,7 +37,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_pool.h"
 
 static pthread_t		thr_pool_herder;
diff --git a/bin/varnishd/cache/cache_priv.h b/bin/varnishd/cache/cache_priv.h
index 2dcf32d..5af6041 100644
--- a/bin/varnishd/cache/cache_priv.h
+++ b/bin/varnishd/cache/cache_priv.h
@@ -29,6 +29,18 @@
  * Stuff that should *never* be exposed to a VMOD
  */
 
+#include "cache.h"
+
+#include "vsb.h"
+
+#include <sys/socket.h>
+
+#include <string.h>
+#include <limits.h>
+#include <unistd.h>
+
+#include "common/common_param.h"
+
 #include "VSC_main.h"
 
 struct vfp;
@@ -139,9 +151,6 @@ int Pool_TrySumstat(const struct worker *wrk);
 void Pool_PurgeStat(unsigned nobj);
 int Pool_Task_Any(struct pool_task *task, enum task_prio prio);
 
-/* cache_proxy.c [VPX] */
-task_func_t VPX_Proto_Sess;
-
 /* cache_range.c [VRG] */
 void VRG_dorange(struct req *req, const char *r);
 
diff --git a/bin/varnishd/cache/cache_range.c b/bin/varnishd/cache/cache_range.c
index ced39c7..e4f8433 100644
--- a/bin/varnishd/cache/cache_range.c
+++ b/bin/varnishd/cache/cache_range.c
@@ -29,8 +29,8 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
-#include "cache/cache_filter.h"
+#include "cache_priv.h"
+#include "cache_filter.h"
 
 #include "vct.h"
 
diff --git a/bin/varnishd/cache/cache_req.c b/bin/varnishd/cache/cache_req.c
index 56ed74c..65c2830 100644
--- a/bin/varnishd/cache/cache_req.c
+++ b/bin/varnishd/cache/cache_req.c
@@ -32,7 +32,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c
index 3cda426..83b1006 100644
--- a/bin/varnishd/cache/cache_req_body.c
+++ b/bin/varnishd/cache/cache_req_body.c
@@ -32,7 +32,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_filter.h"
 #include "vtim.h"
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index c96430b..4823871 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -38,7 +38,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_director.h"
 #include "cache_filter.h"
 #include "cache_transport.h"
diff --git a/bin/varnishd/cache/cache_rfc2616.c b/bin/varnishd/cache/cache_rfc2616.c
index 67679e1..f1171c2 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -31,7 +31,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vtim.h"
 
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index ea18156..28f1ce2 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -36,7 +36,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/bin/varnishd/cache/cache_shmlog.c b/bin/varnishd/cache/cache_shmlog.c
index 4099403..9b28b25 100644
--- a/bin/varnishd/cache/cache_shmlog.c
+++ b/bin/varnishd/cache/cache_shmlog.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/bin/varnishd/cache/cache_vary.c b/bin/varnishd/cache/cache_vary.c
index d5d3e4b..04ab24c 100644
--- a/bin/varnishd/cache/cache_vary.c
+++ b/bin/varnishd/cache/cache_vary.c
@@ -58,7 +58,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vct.h"
 #include "vend.h"
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 26c4772..a667309 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -35,7 +35,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "common/heritage.h"
 
 #include "vrt.h"
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index 4f4c64b..8b16942 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "cache_director.h"
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c
index 000d505..b85367b 100644
--- a/bin/varnishd/cache/cache_vrt_priv.c
+++ b/bin/varnishd/cache/cache_vrt_priv.c
@@ -34,7 +34,7 @@
 
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vrt.h"
 
diff --git a/bin/varnishd/cache/cache_vrt_re.c b/bin/varnishd/cache/cache_vrt_re.c
index f8be46f..6f58480 100644
--- a/bin/varnishd/cache/cache_vrt_re.c
+++ b/bin/varnishd/cache/cache_vrt_re.c
@@ -33,7 +33,7 @@
 
 #include <ctype.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include "vrt.h"
 
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index 1cdb983..3fd5eb4 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -32,7 +32,7 @@
 
 #include <stdio.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "common/heritage.h"
 
 #include "cache_director.h"
diff --git a/bin/varnishd/cache/cache_vrt_vmod.c b/bin/varnishd/cache/cache_vrt_vmod.c
index cb73247..d325b9d 100644
--- a/bin/varnishd/cache/cache_vrt_vmod.c
+++ b/bin/varnishd/cache/cache_vrt_vmod.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <dlfcn.h>
 #include <stdio.h>
diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index b7729b1..6c391ea 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -34,7 +34,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
-#include "cache.h"
+#include "cache_priv.h"
 #include "cache_pool.h"
 
 #include "vtim.h"
diff --git a/bin/varnishd/cache/cache_ws.c b/bin/varnishd/cache/cache_ws.c
index 270aa16..5167247 100644
--- a/bin/varnishd/cache/cache_ws.c
+++ b/bin/varnishd/cache/cache_ws.c
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#include "cache.h"
+#include "cache_priv.h"
 
 #include <stdio.h>
 
diff --git a/bin/varnishd/hash/hash_classic.c b/bin/varnishd/hash/hash_classic.c
index a4e9861..23e4ef9 100644
--- a/bin/varnishd/hash/hash_classic.c
+++ b/bin/varnishd/hash/hash_classic.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "common/heritage.h"
 
 #include <stdio.h>
diff --git a/bin/varnishd/hash/hash_critbit.c b/bin/varnishd/hash/hash_critbit.c
index b84eee1..d48e3e7 100644
--- a/bin/varnishd/hash/hash_critbit.c
+++ b/bin/varnishd/hash/hash_critbit.c
@@ -34,7 +34,7 @@
 
 #include <stdlib.h>
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "hash/hash_slinger.h"
 #include "vmb.h"
diff --git a/bin/varnishd/hash/hash_simple_list.c b/bin/varnishd/hash/hash_simple_list.c
index ffaa2d5..d68ae8a 100644
--- a/bin/varnishd/hash/hash_simple_list.c
+++ b/bin/varnishd/hash/hash_simple_list.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "hash/hash_slinger.h"
 
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 96174a9..b3f6cf1 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "cache/cache_filter.h"
 #include "cache_http1.h"
 
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 3e230cb..d1b5bf0 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 5657e6f..06df250 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -33,7 +33,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/bin/varnishd/http1/cache_http1_line.c b/bin/varnishd/http1/cache_http1_line.c
index 8215fab..46f583a 100644
--- a/bin/varnishd/http1/cache_http1_line.c
+++ b/bin/varnishd/http1/cache_http1_line.c
@@ -35,7 +35,7 @@
 #include "config.h"
 
 #include <sys/uio.h>
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/bin/varnishd/http1/cache_http1_pipe.c b/bin/varnishd/http1/cache_http1_pipe.c
index 49a10e5..37032e4 100644
--- a/bin/varnishd/http1/cache_http1_pipe.c
+++ b/bin/varnishd/http1/cache_http1_pipe.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <poll.h>
 #include <stdio.h>
diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c
index 2e691fd..0bc6df9 100644
--- a/bin/varnishd/http1/cache_http1_proto.c
+++ b/bin/varnishd/http1/cache_http1_proto.c
@@ -45,7 +45,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "cache/cache_transport.h"
 
 #include "cache_http1.h"
diff --git a/bin/varnishd/http1/cache_http1_vfp.c b/bin/varnishd/http1/cache_http1_vfp.c
index 35c13a6..fd770ea 100644
--- a/bin/varnishd/http1/cache_http1_vfp.c
+++ b/bin/varnishd/http1/cache_http1_vfp.c
@@ -38,7 +38,7 @@
 #include <errno.h>
 #include <inttypes.h>
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "cache/cache_filter.h"
 #include "cache_http1.h"
 
diff --git a/bin/varnishd/http2/cache_http2_deliver.c b/bin/varnishd/http2/cache_http2_deliver.c
index 11ca12b..0277b21 100644
--- a/bin/varnishd/http2/cache_http2_deliver.c
+++ b/bin/varnishd/http2/cache_http2_deliver.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <netinet/in.h>
 
diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index 460b43f..973827d 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <ctype.h>
 #include <stdio.h>
@@ -92,7 +92,7 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
 static h2_error
 h2h_addhdr(struct http *hp, char *b, size_t namelen, size_t len)
 {
-	/* XXX: This might belong in cache/cache_http.c */
+	/* XXX: This might belong in cache/cache_priv.http.c */
 	unsigned n;
 
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
diff --git a/bin/varnishd/http2/cache_http2_panic.c b/bin/varnishd/http2/cache_http2_panic.c
index b0f1a12..b160343 100644
--- a/bin/varnishd/http2/cache_http2_panic.c
+++ b/bin/varnishd/http2/cache_http2_panic.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "cache/cache_transport.h"
 #include "http2/cache_http2.h"
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 4eff4e0..13ee528 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index fa837c9..b17b4f2 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "cache/cache_transport.h"
 #include "http2/cache_http2.h"
diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index e70341f..8785e47 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <stdio.h>
 
diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c
index 8444f39..f381641 100644
--- a/bin/varnishd/proxy/cache_proxy_proto.c
+++ b/bin/varnishd/proxy/cache_proxy_proto.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <netinet/in.h>
 
diff --git a/bin/varnishd/storage/mgt_storage_persistent.c b/bin/varnishd/storage/mgt_storage_persistent.c
index d0155cd..9e6255e 100644
--- a/bin/varnishd/storage/mgt_storage_persistent.c
+++ b/bin/varnishd/storage/mgt_storage_persistent.c
@@ -35,7 +35,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "common/heritage.h"
 
 #include <sys/mman.h>
diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c
index fb280af..084c82d 100644
--- a/bin/varnishd/storage/stevedore.c
+++ b/bin/varnishd/storage/stevedore.c
@@ -33,7 +33,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c
index b0480b8..287d05b 100644
--- a/bin/varnishd/storage/storage_file.c
+++ b/bin/varnishd/storage/storage_file.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "common/heritage.h"
 
 #include <sys/mman.h>
diff --git a/bin/varnishd/storage/storage_lru.c b/bin/varnishd/storage/storage_lru.c
index e7f0bff..33dca6b 100644
--- a/bin/varnishd/storage/storage_lru.c
+++ b/bin/varnishd/storage/storage_lru.c
@@ -32,7 +32,7 @@
 
 #include <stdlib.h>
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "hash/hash_slinger.h"
 
 #include "storage/storage.h"
diff --git a/bin/varnishd/storage/storage_malloc.c b/bin/varnishd/storage/storage_malloc.c
index 7da5c4a..60cd988 100644
--- a/bin/varnishd/storage/storage_malloc.c
+++ b/bin/varnishd/storage/storage_malloc.c
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "common/heritage.h"
 
 #include <stdio.h>
diff --git a/bin/varnishd/storage/storage_persistent.c b/bin/varnishd/storage/storage_persistent.c
index 6c4d79e..af22649 100644
--- a/bin/varnishd/storage/storage_persistent.c
+++ b/bin/varnishd/storage/storage_persistent.c
@@ -35,7 +35,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <sys/mman.h>
 
diff --git a/bin/varnishd/storage/storage_persistent_silo.c b/bin/varnishd/storage/storage_persistent_silo.c
index 36aa348..e0115c0 100644
--- a/bin/varnishd/storage/storage_persistent_silo.c
+++ b/bin/varnishd/storage/storage_persistent_silo.c
@@ -34,7 +34,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/bin/varnishd/storage/storage_persistent_subr.c b/bin/varnishd/storage/storage_persistent_subr.c
index 63ff47d..fc75ddb 100644
--- a/bin/varnishd/storage/storage_persistent_subr.c
+++ b/bin/varnishd/storage/storage_persistent_subr.c
@@ -36,7 +36,7 @@
 #include "config.h"
 
 #include <stddef.h>
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 #include "common/heritage.h"
 
 #include <sys/mman.h>
diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c
index ad33b7e..d07166d 100644
--- a/bin/varnishd/storage/storage_simple.c
+++ b/bin/varnishd/storage/storage_simple.c
@@ -29,7 +29,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "cache/cache_obj.h"
 #include "hash/hash_slinger.h"
diff --git a/bin/varnishd/waiter/cache_waiter.c b/bin/varnishd/waiter/cache_waiter.c
index 80a2f1f..b7afaf3 100644
--- a/bin/varnishd/waiter/cache_waiter.c
+++ b/bin/varnishd/waiter/cache_waiter.c
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <stdlib.h>
 
diff --git a/bin/varnishd/waiter/cache_waiter_epoll.c b/bin/varnishd/waiter/cache_waiter_epoll.c
index 129bb87..fa381e9 100644
--- a/bin/varnishd/waiter/cache_waiter_epoll.c
+++ b/bin/varnishd/waiter/cache_waiter_epoll.c
@@ -39,7 +39,7 @@
 
 #include <errno.h>
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "waiter/waiter.h"
 #include "waiter/waiter_priv.h"
diff --git a/bin/varnishd/waiter/cache_waiter_kqueue.c b/bin/varnishd/waiter/cache_waiter_kqueue.c
index 50bdad3..546e1df 100644
--- a/bin/varnishd/waiter/cache_waiter_kqueue.c
+++ b/bin/varnishd/waiter/cache_waiter_kqueue.c
@@ -33,7 +33,7 @@
 
 #if defined(HAVE_KQUEUE)
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include <sys/event.h>
 
diff --git a/bin/varnishd/waiter/cache_waiter_poll.c b/bin/varnishd/waiter/cache_waiter_poll.c
index fefe22f..6c953c6 100644
--- a/bin/varnishd/waiter/cache_waiter_poll.c
+++ b/bin/varnishd/waiter/cache_waiter_poll.c
@@ -34,7 +34,7 @@
 #include <poll.h>
 #include <stdlib.h>
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "waiter/waiter.h"
 #include "waiter/waiter_priv.h"
diff --git a/bin/varnishd/waiter/cache_waiter_ports.c b/bin/varnishd/waiter/cache_waiter_ports.c
index a7f76c9..50f8b1d 100644
--- a/bin/varnishd/waiter/cache_waiter_ports.c
+++ b/bin/varnishd/waiter/cache_waiter_ports.c
@@ -73,7 +73,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "cache/cache.h"
+#include "cache/cache_priv.h"
 
 #include "waiter/waiter.h"
 #include "waiter/waiter_priv.h"
diff --git a/lib/libvmod_blob/vmod_blob.c b/lib/libvmod_blob/vmod_blob.c
index 40702d1..73dd831 100644
--- a/lib/libvmod_blob/vmod_blob.c
+++ b/lib/libvmod_blob/vmod_blob.c
@@ -29,6 +29,7 @@
 #include "config.h"
 #include <errno.h>
 #include <pthread.h>
+#include <string.h>
 
 #include "vdef.h"
 #include "vrt.h"
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 8a1fe41..e538543 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -31,6 +31,9 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
 
 #include "cache/cache.h"
 
@@ -41,6 +44,8 @@
 #include "vtim.h"
 #include "vcc_if.h"
 
+#include "common/common_param.h"
+
 #define WARN_RETIRED()							\
 	do {								\
 		VSL(SLT_Error, 0,					\
diff --git a/lib/libvmod_debug/vmod_debug_dyn.c b/lib/libvmod_debug/vmod_debug_dyn.c
index 10f97aa..af61742 100644
--- a/lib/libvmod_debug/vmod_debug_dyn.c
+++ b/lib/libvmod_debug/vmod_debug_dyn.c
@@ -30,6 +30,8 @@
 
 #include <netdb.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
 
 #include "cache/cache.h"
 
diff --git a/lib/libvmod_debug/vmod_debug_obj.c b/lib/libvmod_debug/vmod_debug_obj.c
index ea758ed..9dfef9d 100644
--- a/lib/libvmod_debug/vmod_debug_obj.c
+++ b/lib/libvmod_debug/vmod_debug_obj.c
@@ -29,6 +29,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 
diff --git a/lib/libvmod_directors/fall_back.c b/lib/libvmod_directors/fall_back.c
index 3e1794f..9a4d392 100644
--- a/lib/libvmod_directors/fall_back.c
+++ b/lib/libvmod_directors/fall_back.c
@@ -29,6 +29,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 #include "cache/cache_director.h"
diff --git a/lib/libvmod_directors/hash.c b/lib/libvmod_directors/hash.c
index 71a4366..60fa834 100644
--- a/lib/libvmod_directors/hash.c
+++ b/lib/libvmod_directors/hash.c
@@ -29,6 +29,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 #include "cache/cache_director.h"
diff --git a/lib/libvmod_directors/round_robin.c b/lib/libvmod_directors/round_robin.c
index 3932938..8a867cc 100644
--- a/lib/libvmod_directors/round_robin.c
+++ b/lib/libvmod_directors/round_robin.c
@@ -29,6 +29,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 #include "cache/cache_director.h"
diff --git a/lib/libvmod_directors/shard_cfg.c b/lib/libvmod_directors/shard_cfg.c
index f36d2d5..7fc5056 100644
--- a/lib/libvmod_directors/shard_cfg.c
+++ b/lib/libvmod_directors/shard_cfg.c
@@ -29,8 +29,10 @@
 
 #include "config.h"
 
+#include <limits.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "cache/cache.h"
 #include "cache/cache_director.h"
diff --git a/lib/libvmod_directors/shard_hash.c b/lib/libvmod_directors/shard_hash.c
index 365f86b..64e7e15 100644
--- a/lib/libvmod_directors/shard_hash.c
+++ b/lib/libvmod_directors/shard_hash.c
@@ -30,6 +30,8 @@
 
 #include "config.h"
 
+#include <string.h>
+
 #include "cache/cache.h"
 
 #include "vrt.h"
diff --git a/lib/libvmod_directors/vmod_shard.c b/lib/libvmod_directors/vmod_shard.c
index 8765ef9..c85c9b4 100644
--- a/lib/libvmod_directors/vmod_shard.c
+++ b/lib/libvmod_directors/vmod_shard.c
@@ -30,6 +30,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 
diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index 915b7f2..91f29ca 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -34,7 +34,9 @@
 
 #include <ctype.h>
 #include <stdlib.h>
+#include <string.h>
 #include <syslog.h>
+#include <sys/socket.h>
 
 #include "cache/cache.h"
 
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index 24dd571..13b85de 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -30,7 +30,10 @@
 #include "config.h"
 
 #include <ctype.h>
+#include <limits.h>
+#include <string.h>
 #include <stdlib.h>
+#include <sys/socket.h>
 
 #include <netdb.h>
 
diff --git a/lib/libvmod_std/vmod_std_fileread.c b/lib/libvmod_std/vmod_std_fileread.c
index c2a7e5f..8a69921 100644
--- a/lib/libvmod_std/vmod_std_fileread.c
+++ b/lib/libvmod_std/vmod_std_fileread.c
@@ -40,6 +40,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 
diff --git a/lib/libvmod_std/vmod_std_querysort.c b/lib/libvmod_std/vmod_std_querysort.c
index 2180ff9..3efe155 100644
--- a/lib/libvmod_std/vmod_std_querysort.c
+++ b/lib/libvmod_std/vmod_std_querysort.c
@@ -29,6 +29,7 @@
 #include "config.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "cache/cache.h"
 
diff --git a/lib/libvmod_vtc/vmod_vtc.c b/lib/libvmod_vtc/vmod_vtc.c
index 9fd3fc4..840df35 100644
--- a/lib/libvmod_vtc/vmod_vtc.c
+++ b/lib/libvmod_vtc/vmod_vtc.c
@@ -31,6 +31,8 @@
 
 #include <errno.h>
 #include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "cache/cache.h"
 


More information about the varnish-commit mailing list