<div dir="ltr"><div><div>As I mentioned to Dridi I'm not too thrilled about this. <br><br>This pollutes cache.h and causes artificial breakages. I'd prefer, if we really want to do this, to take the _int.h approach.<br><br></div>I also had a chat with Martin not so long ago and one of the things that came in that discussion is the possibility of installing all the includes.<br></div>This is a step backwards from that.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 23, 2015 at 11:35 AM, Dridi Boukelmoune <span dir="ltr"><<a href="mailto:dridi.boukelmoune@gmail.com" target="_blank">dridi.boukelmoune@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
commit d771942c0c6f151e267b63bbc548a4d4371b25be<br>
Author: Dridi Boukelmoune <<a href="mailto:dridi.boukelmoune@gmail.com">dridi.boukelmoune@gmail.com</a>><br>
Date:   Sun Aug 23 12:29:29 2015 +0200<br>
<br>
    Hide backends and directors implementation details<br>
<br>
    Don't install cache_backend.h and cache_director.h, they expose more<br>
    than what a VMOD needs to see.<br>
<br>
    The VRT API jumps directly from struct vrt_backend to struct director,<br>
    which makes struct backend more than simply opaque, it is completely<br>
    invisible. However struct director needs to be visible and has been<br>
    moved to cache.h along with its functions definitions.<br>
<br>
diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am<br>
index dd2bae2..eb01348 100644<br>
--- a/bin/varnishd/Makefile.am<br>
+++ b/bin/varnishd/Makefile.am<br>
@@ -99,6 +99,8 @@ varnishd_SOURCES = \<br>
<br>
 noinst_HEADERS = \<br>
        builtin_vcl.h \<br>
+       cache/cache_backend.h \<br>
+       cache/cache_director.h \<br>
        cache/cache_esi.h \<br>
        cache/cache_pool.h \<br>
        common/heritage.h \<br>
@@ -116,8 +118,6 @@ noinst_HEADERS = \<br>
 nobase_pkginclude_HEADERS = \<br>
        cache/cache.h \<br>
        cache/cache_filter.h \<br>
-       cache/cache_backend.h \<br>
-       cache/cache_director.h \<br>
        common/common.h \<br>
        common/params.h \<br>
        waiter/waiter.h<br>
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h<br>
index 648dad4..ed72296 100644<br>
--- a/bin/varnishd/cache/cache.h<br>
+++ b/bin/varnishd/cache/cache.h<br>
@@ -190,6 +190,47 @@ struct http {<br>
 };<br>
<br>
 /*--------------------------------------------------------------------<br>
+ * Director public APIs<br>
+ */<br>
+<br>
+typedef unsigned vdi_healthy_f(const struct director *, const struct busyobj *,<br>
+    double *changed);<br>
+<br>
+typedef const struct director *vdi_resolve_f(const struct director *,<br>
+    struct worker *, struct busyobj *);<br>
+<br>
+typedef int vdi_gethdrs_f(const struct director *, struct worker *,<br>
+    struct busyobj *);<br>
+typedef int vdi_getbody_f(const struct director *, struct worker *,<br>
+    struct busyobj *);<br>
+typedef const struct suckaddr *vdi_getip_f(const struct director *,<br>
+    struct worker *, struct busyobj *);<br>
+typedef void vdi_finish_f(const struct director *, struct worker *,<br>
+    struct busyobj *);<br>
+<br>
+typedef void vdi_http1pipe_f(const struct director *, struct req *,<br>
+    struct busyobj *);<br>
+<br>
+typedef void vdi_panic_f(const struct director *, struct vsb *);<br>
+<br>
+struct director {<br>
+       unsigned                magic;<br>
+#define DIRECTOR_MAGIC         0x3336351d<br>
+       const char              *name;<br>
+       char                    *vcl_name;<br>
+       vdi_http1pipe_f         *http1pipe;<br>
+       vdi_healthy_f           *healthy;<br>
+       vdi_resolve_f           *resolve;<br>
+       vdi_gethdrs_f           *gethdrs;<br>
+       vdi_getbody_f           *getbody;<br>
+       vdi_getip_f             *getip;<br>
+       vdi_finish_f            *finish;<br>
+       vdi_panic_f             *panic;<br>
+       void                    *priv;<br>
+       const void              *priv2;<br>
+};<br>
+<br>
+/*--------------------------------------------------------------------<br>
  * VFP filter state<br>
  */<br>
<br>
diff --git a/bin/varnishd/cache/cache_director.h b/bin/varnishd/cache/cache_director.h<br>
index cf20dc1..3bccf80 100644<br>
--- a/bin/varnishd/cache/cache_director.h<br>
+++ b/bin/varnishd/cache/cache_director.h<br>
@@ -37,49 +37,6 @@<br>
  *<br>
  */<br>
<br>
-/*--------------------------------------------------------------------<br>
- * A director is a piece of code which selects one of possibly multiple<br>
- * backends to use.<br>
- */<br>
-<br>
-<br>
-typedef unsigned vdi_healthy_f(const struct director *, const struct busyobj *,<br>
-    double *changed);<br>
-<br>
-typedef const struct director *vdi_resolve_f(const struct director *,<br>
-    struct worker *, struct busyobj *);<br>
-<br>
-typedef int vdi_gethdrs_f(const struct director *, struct worker *,<br>
-    struct busyobj *);<br>
-typedef int vdi_getbody_f(const struct director *, struct worker *,<br>
-    struct busyobj *);<br>
-typedef const struct suckaddr *vdi_getip_f(const struct director *,<br>
-    struct worker *, struct busyobj *);<br>
-typedef void vdi_finish_f(const struct director *, struct worker *,<br>
-    struct busyobj *);<br>
-<br>
-typedef void vdi_http1pipe_f(const struct director *, struct req *,<br>
-    struct busyobj *);<br>
-<br>
-typedef void vdi_panic_f(const struct director *, struct vsb *);<br>
-<br>
-struct director {<br>
-       unsigned                magic;<br>
-#define DIRECTOR_MAGIC         0x3336351d<br>
-       const char              *name;<br>
-       char                    *vcl_name;<br>
-       vdi_http1pipe_f         *http1pipe;<br>
-       vdi_healthy_f           *healthy;<br>
-       vdi_resolve_f           *resolve;<br>
-       vdi_gethdrs_f           *gethdrs;<br>
-       vdi_getbody_f           *getbody;<br>
-       vdi_getip_f             *getip;<br>
-       vdi_finish_f            *finish;<br>
-       vdi_panic_f             *panic;<br>
-       void                    *priv;<br>
-       const void              *priv2;<br>
-};<br>
-<br>
 /* cache_director.c */<br>
<br>
 int VDI_GetHdr(struct worker *, struct busyobj *);<br>
diff --git a/lib/libvmod_directors/vdir.c b/lib/libvmod_directors/vdir.c<br>
index 411df34..1738bcf 100644<br>
--- a/lib/libvmod_directors/vdir.c<br>
+++ b/lib/libvmod_directors/vdir.c<br>
@@ -31,7 +31,6 @@<br>
 #include <stdlib.h><br>
<br>
 #include "cache/cache.h"<br>
-#include "cache/cache_director.h"<br>
<br>
 #include "vrt.h"<br>
 #include "vbm.h"<br>
<br>
_______________________________________________<br>
varnish-commit mailing list<br>
<a href="mailto:varnish-commit@varnish-cache.org">varnish-commit@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit</a><br>
</blockquote></div><br></div>