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

Isolate VCL-internals more in cache_vcl.c

parent 93112f34
......@@ -1065,15 +1065,16 @@ 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_conf *);
void VCL_Init(void);
const char *VCL_Method_Name(unsigned);
const char *VCL_Name(const struct VCL_conf *);
void VCL_Panic(struct vsb *, const struct VCL_conf *);
void VCL_Refresh(struct VCL_conf **vcc);
void VCL_Ref(struct VCL_conf *vcc);
void VCL_Rel(struct VCL_conf **vcc);
void VCL_Poll(void);
struct director *VCL_DefaultDirector(const struct VCL_conf *);
void VCL_Ref(struct VCL_conf *);
void VCL_Refresh(struct VCL_conf **);
void VCL_Rel(struct VCL_conf **);
const char *VCL_Return_Name(unsigned);
const char *VCL_Method_Name(unsigned);
#define VCL_MET_MAC(l,u,b) \
void VCL_##l##_method(struct VCL_conf *, struct worker *, struct req *, \
......
......@@ -41,7 +41,6 @@
#include "cache_backend.h"
#include "vcli.h"
#include "vcli_priv.h"
#include "vcl.h"
#include "vsa.h"
#include "vrt.h"
#include "vtim.h"
......@@ -162,13 +161,13 @@ backend_find(struct cli *cli, const char *matcher, bf_func *func, void *priv)
AN(vsb);
if (matcher == NULL || *matcher == '\0' || !strcmp(matcher, "*")) {
// all backends in active VCL
VSB_printf(vsb, "%s.*", vcc->loaded_name);
VSB_printf(vsb, "%s.*", VCL_Name(vcc));
} else if (strchr(matcher, '.') != NULL) {
// use pattern as is
VSB_cat(vsb, matcher);
} else {
// pattern applies to active vcl
VSB_printf(vsb, "%s.%s", vcc->loaded_name, matcher);
VSB_printf(vsb, "%s.%s", VCL_Name(vcc), matcher);
}
AZ(VSB_finish(vsb));
Lck_Lock(&backends_mtx);
......
......@@ -253,6 +253,13 @@ VCL_DefaultDirector(const struct VCL_conf *vcc)
return (*vcc->default_director);
}
const char *
VCL_Name(const struct VCL_conf *vcc)
{
AN(vcc);
return (vcc->loaded_name);
}
/*--------------------------------------------------------------------*/
static struct vcl *
......
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