[4.1] dc0b0ca Revert "Hide backends and directors implementation details"

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Sep 4 15:54:56 CEST 2015


commit dc0b0ca1e818096505ea856b905c974fa847aa41
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Aug 27 09:53:26 2015 +0200

    Revert "Hide backends and directors implementation details"
    
    This reverts commit d771942c0c6f151e267b63bbc548a4d4371b25be, it needs
    to be discussed first.

diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index eb01348..dd2bae2 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -99,8 +99,6 @@ varnishd_SOURCES = \
 
 noinst_HEADERS = \
 	builtin_vcl.h \
-	cache/cache_backend.h \
-	cache/cache_director.h \
 	cache/cache_esi.h \
 	cache/cache_pool.h \
 	common/heritage.h \
@@ -118,6 +116,8 @@ noinst_HEADERS = \
 nobase_pkginclude_HEADERS = \
 	cache/cache.h \
 	cache/cache_filter.h \
+	cache/cache_backend.h \
+	cache/cache_director.h \
 	common/common.h \
 	common/params.h \
 	waiter/waiter.h
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index ed72296..648dad4 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -190,47 +190,6 @@ struct http {
 };
 
 /*--------------------------------------------------------------------
- * Director public APIs
- */
-
-typedef unsigned vdi_healthy_f(const struct director *, const struct busyobj *,
-    double *changed);
-
-typedef const struct director *vdi_resolve_f(const struct director *,
-    struct worker *, struct busyobj *);
-
-typedef int vdi_gethdrs_f(const struct director *, struct worker *,
-    struct busyobj *);
-typedef int vdi_getbody_f(const struct director *, struct worker *,
-    struct busyobj *);
-typedef const struct suckaddr *vdi_getip_f(const struct director *,
-    struct worker *, struct busyobj *);
-typedef void vdi_finish_f(const struct director *, struct worker *,
-    struct busyobj *);
-
-typedef void vdi_http1pipe_f(const struct director *, struct req *,
-    struct busyobj *);
-
-typedef void vdi_panic_f(const struct director *, struct vsb *);
-
-struct director {
-	unsigned		magic;
-#define DIRECTOR_MAGIC		0x3336351d
-	const char		*name;
-	char			*vcl_name;
-	vdi_http1pipe_f		*http1pipe;
-	vdi_healthy_f		*healthy;
-	vdi_resolve_f		*resolve;
-	vdi_gethdrs_f		*gethdrs;
-	vdi_getbody_f		*getbody;
-	vdi_getip_f		*getip;
-	vdi_finish_f		*finish;
-	vdi_panic_f		*panic;
-	void			*priv;
-	const void		*priv2;
-};
-
-/*--------------------------------------------------------------------
  * VFP filter state
  */
 
diff --git a/bin/varnishd/cache/cache_director.h b/bin/varnishd/cache/cache_director.h
index 3bccf80..cf20dc1 100644
--- a/bin/varnishd/cache/cache_director.h
+++ b/bin/varnishd/cache/cache_director.h
@@ -37,6 +37,49 @@
  *
  */
 
+/*--------------------------------------------------------------------
+ * A director is a piece of code which selects one of possibly multiple
+ * backends to use.
+ */
+
+
+typedef unsigned vdi_healthy_f(const struct director *, const struct busyobj *,
+    double *changed);
+
+typedef const struct director *vdi_resolve_f(const struct director *,
+    struct worker *, struct busyobj *);
+
+typedef int vdi_gethdrs_f(const struct director *, struct worker *,
+    struct busyobj *);
+typedef int vdi_getbody_f(const struct director *, struct worker *,
+    struct busyobj *);
+typedef const struct suckaddr *vdi_getip_f(const struct director *,
+    struct worker *, struct busyobj *);
+typedef void vdi_finish_f(const struct director *, struct worker *,
+    struct busyobj *);
+
+typedef void vdi_http1pipe_f(const struct director *, struct req *,
+    struct busyobj *);
+
+typedef void vdi_panic_f(const struct director *, struct vsb *);
+
+struct director {
+	unsigned		magic;
+#define DIRECTOR_MAGIC		0x3336351d
+	const char		*name;
+	char			*vcl_name;
+	vdi_http1pipe_f		*http1pipe;
+	vdi_healthy_f		*healthy;
+	vdi_resolve_f		*resolve;
+	vdi_gethdrs_f		*gethdrs;
+	vdi_getbody_f		*getbody;
+	vdi_getip_f		*getip;
+	vdi_finish_f		*finish;
+	vdi_panic_f		*panic;
+	void			*priv;
+	const void		*priv2;
+};
+
 /* cache_director.c */
 
 int VDI_GetHdr(struct worker *, struct busyobj *);
diff --git a/lib/libvmod_directors/vdir.c b/lib/libvmod_directors/vdir.c
index 1738bcf..411df34 100644
--- a/lib/libvmod_directors/vdir.c
+++ b/lib/libvmod_directors/vdir.c
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 
 #include "cache/cache.h"
+#include "cache/cache_director.h"
 
 #include "vrt.h"
 #include "vbm.h"



More information about the varnish-commit mailing list