Commit c9d3b3ff authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Change from "struct director *" to VCL_BACKEND (=constify)

parent a59d33e4
......@@ -448,12 +448,13 @@ VRT_backend_vsm_need(VRT_CTX)
return (VRT_VSC_Overhead(VSC_vbe_size));
}
struct director * v_matchproto_()
VCL_BACKEND v_matchproto_()
VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
const struct vrt_backend *vrt)
{
struct backend *be;
struct director *d;
VCL_BACKEND bb;
struct vcl *vcl;
const struct vrt_backend_probe *vbp;
int retval;
......@@ -493,7 +494,8 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
retval = VRT_AddDirector(ctx, d, "%s", vrt->vcl_name);
if (retval) {
VRT_delete_backend(ctx, &d);
bb = d;
VRT_delete_backend(ctx, &bb);
return (NULL);
}
......@@ -516,7 +518,7 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
return (d);
}
struct director * v_matchproto_()
VCL_BACKEND v_matchproto_()
VRT_new_backend(VRT_CTX, const struct vrt_backend *vrt)
{
return (VRT_new_backend_clustered(ctx, NULL, vrt));
......@@ -528,9 +530,9 @@ VRT_new_backend(VRT_CTX, const struct vrt_backend *vrt)
*/
void
VRT_delete_backend(VRT_CTX, struct director **dp)
VRT_delete_backend(VRT_CTX, VCL_BACKEND *dp)
{
struct director *d;
VCL_BACKEND d;
struct backend *be;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
......
......@@ -385,7 +385,7 @@ enum vry_finish_flag { KEEP, DISCARD };
void VRY_Finish(struct req *req, enum vry_finish_flag);
/* cache_vcl.c */
struct director *VCL_DefaultDirector(const struct vcl *);
VCL_BACKEND VCL_DefaultDirector(const struct vcl *);
const struct vrt_backend_probe *VCL_DefaultProbe(const struct vcl *);
void VCL_Init(void);
void VCL_Panic(struct vsb *, const struct vcl *);
......
......@@ -210,7 +210,7 @@ VRT_DelDirector(struct director *d)
/*--------------------------------------------------------------------*/
struct director *
VCL_BACKEND
VCL_DefaultDirector(const struct vcl *vcl)
{
......
......@@ -406,12 +406,12 @@ VCL_VOID VRT_Rollback(VRT_CTX, VCL_HTTP);
VCL_VOID VRT_synth_page(VRT_CTX, const char *, ...);
/* Backend related */
struct director *VRT_new_backend(VRT_CTX, const struct vrt_backend *);
struct director *VRT_new_backend_clustered(VRT_CTX,
VCL_BACKEND VRT_new_backend(VRT_CTX, const struct vrt_backend *);
VCL_BACKEND VRT_new_backend_clustered(VRT_CTX,
struct vsmw_cluster *, const struct vrt_backend *);
size_t VRT_backend_vsm_need(VRT_CTX);
void VRT_delete_backend(VRT_CTX, struct director **);
int VRT_backend_healthy(VRT_CTX, struct director *);
void VRT_delete_backend(VRT_CTX, VCL_BACKEND *);
int VRT_backend_healthy(VRT_CTX, VCL_BACKEND);
/* VSM related */
struct vsmw_cluster *VRT_VSM_Cluster_New(VRT_CTX, size_t);
......
......@@ -656,7 +656,7 @@ struct VCL_conf {
#define VCL_CONF_MAGIC 0x7406c509 /* from /dev/random */
unsigned syntax;
struct director **default_director;
VCL_BACKEND *default_director;
const struct vrt_backend_probe *default_probe;
unsigned nref;
const struct vrt_ref *ref;
......
......@@ -547,7 +547,7 @@ vcc_ParseBackend(struct vcc *tl)
sym->noref = 1;
}
}
Fh(tl, 0, "\nstatic struct director *%s;\n", dn);
Fh(tl, 0, "\nstatic VCL_BACKEND %s;\n", dn);
vcc_ParseHostDef(tl, t_be, dn);
if (tl->err) {
VSB_printf(tl->sb,
......
......@@ -48,7 +48,7 @@ struct xyzzy_debug_dyn {
#define VMOD_DEBUG_DYN_MAGIC 0x9b77ccbd
pthread_mutex_t mtx;
char *vcl_name;
struct director *dir;
VCL_BACKEND dir;
};
struct xyzzy_debug_dyn_uds {
......@@ -56,7 +56,7 @@ struct xyzzy_debug_dyn_uds {
#define VMOD_DEBUG_UDS_MAGIC 0x6c7370e6
pthread_mutex_t mtx;
char *vcl_name;
struct director *dir;
VCL_BACKEND dir;
};
static void
......@@ -65,7 +65,7 @@ dyn_dir_init(VRT_CTX, struct xyzzy_debug_dyn *dyn,
{
struct addrinfo hints, *res = NULL;
struct suckaddr *sa;
struct director *dir, *dir2;
VCL_BACKEND dir, dir2;
struct vrt_backend vrt;
CHECK_OBJ_NOTNULL(dyn, VMOD_DEBUG_DYN_MAGIC);
......@@ -183,7 +183,7 @@ xyzzy_dyn_refresh(VRT_CTX, struct xyzzy_debug_dyn *dyn,
static int
dyn_uds_init(VRT_CTX, struct xyzzy_debug_dyn_uds *uds, VCL_STRING path)
{
struct director *dir, *dir2;
VCL_BACKEND dir, dir2;
struct vrt_backend vrt;
struct stat st;
......
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