Commit 5dd5f9dd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Miniobj-ify the compiled backend and probe structs

parent 93b6da19
......@@ -140,20 +140,24 @@ extern const void * const vrt_magic_string_end;
extern const void * const vrt_magic_string_unset;
struct vrt_backend_probe {
const char *url;
const char *request;
double timeout;
double interval;
unsigned exp_status;
unsigned window;
unsigned threshold;
unsigned initial;
unsigned magic;
#define VRT_BACKEND_PROBE_MAGIC 0x84998490
const char *url;
const char *request;
double timeout;
double interval;
unsigned exp_status;
unsigned window;
unsigned threshold;
unsigned initial;
};
/*
* A backend is a host+port somewhere on the network
*/
struct vrt_backend {
unsigned magic;
#define VRT_BACKEND_MAGIC 0x4799ce6b
const char *vcl_name;
const char *ipv4_addr;
const char *ipv6_addr;
......
......@@ -126,6 +126,7 @@ vcc_ParseProbeSpec(struct vcc *tl)
status = 0;
Fh(tl, 0, "static const struct vrt_backend_probe vgc_probe__%d = {\n",
tl->nprobe++);
Fh(tl, 0, "\t.magic = VRT_BACKEND_PROBE_MAGIC,\n");
while (tl->t->tok != '}') {
vcc_IsField(tl, &t_field, fs);
......@@ -305,6 +306,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be)
Fb(tl, 0, "\nstatic const struct vrt_backend vgc_dir_priv_%s = {\n",
vgcname);
Fb(tl, 0, "\t.magic = VRT_BACKEND_MAGIC,\n");
Fb(tl, 0, "\t.vcl_name = \"%.*s", PF(t_be));
Fb(tl, 0, "\",\n");
......
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