Commit dc0b0ca1 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Revert "Hide backends and directors implementation details"

This reverts commit d771942c, it needs
to be discussed first.
parent 34360fd1
......@@ -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
......
......@@ -189,47 +189,6 @@ struct http {
uint8_t conds; /* If-* headers present */
};
/*--------------------------------------------------------------------
* 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
*/
......
......@@ -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 *);
......
......@@ -31,6 +31,7 @@
#include <stdlib.h>
#include "cache/cache.h"
#include "cache/cache_director.h"
#include "vrt.h"
#include "vbm.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment