Commit 139fc3dd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate the vrt_dir_simple structure, it is not really needed.



git-svn-id: http://www.varnish-cache.org/svn/trunk@4391 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7b9f6934
......@@ -95,7 +95,7 @@ vdi_simple_fini(struct director *d)
void
VRT_init_dir_simple(struct cli *cli, struct director **bp,
const struct vrt_dir_simple *t)
const struct vrt_backend *t)
{
struct vdi_simple *vs;
......@@ -106,12 +106,12 @@ VRT_init_dir_simple(struct cli *cli, struct director **bp,
vs->dir.magic = DIRECTOR_MAGIC;
vs->dir.priv = vs;
vs->dir.name = "simple";
REPLACE(vs->dir.vcl_name, t->host->vcl_name);
REPLACE(vs->dir.vcl_name, t->vcl_name);
vs->dir.getfd = vdi_simple_getfd;
vs->dir.fini = vdi_simple_fini;
vs->dir.healthy = vdi_simple_healthy;
vs->backend = VBE_AddBackend(cli, t->host);
vs->backend = VBE_AddBackend(cli, t);
*bp = &vs->dir;
}
......@@ -78,15 +78,6 @@ struct vrt_backend {
struct vrt_backend_probe probe;
};
/*
* A director with a predictable reply
*/
struct vrt_dir_simple {
const char *name;
const struct vrt_backend *host;
};
/*
* A director with an unpredictable reply
*/
......@@ -171,7 +162,7 @@ void VRT_synth_page(struct sess *sp, unsigned flags, const char *, ...);
/* Backend related */
void VRT_init_dir_simple(struct cli *, struct director **,
const struct vrt_dir_simple *);
const struct vrt_backend *);
void VRT_init_dir_random(struct cli *, struct director **,
const struct vrt_dir_random *);
void VRT_init_dir_round_robin(struct cli *, struct director **,
......
......@@ -747,16 +747,10 @@ vcc_ParseSimpleDirector(struct tokenlist *tl, const struct token *t_first,
VTAILQ_INSERT_TAIL(&tl->hosts, h, list);
Fi(tl, 0,
"\tVRT_init_dir_simple(cli, &VGC_backend_%.*s , &sbe_%.*s);\n",
PF(h->name), PF(h->name));
"\tVRT_init_dir_simple(cli, &VGC_backend_%.*s , &bh_%d);\n",
PF(h->name), h->hnum);
Ff(tl, 0, "\tVRT_fini_dir(cli, VGC_backend_%.*s);\n", PF(h->name));
Fh(tl, 0, "\nstatic const struct vrt_dir_simple sbe_%.*s = {\n",
PF(h->name));
Fh(tl, 0, "\t.name = \"%.*s\",\n", PF(h->name));
Fh(tl, 0, "\t.host = &bh_%d,\n", h->hnum);
Fh(tl, 0, "};\n");
}
/*--------------------------------------------------------------------
......
/*
* $Id: vcc_gen_fixed_token.tcl 4358 2009-11-19 19:03:25Z phk $
* $Id: vcc_gen_fixed_token.tcl 4376 2009-11-27 11:06:32Z phk $
*
* NB: This file is machine generated, DO NOT EDIT!
*
......@@ -159,8 +159,8 @@ vcl_output_lang_h(struct vsb *sb)
/* ../../include/vcl.h */
vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4358 2009-11-19 19");
vsb_cat(sb, ":03:25Z phk $\n *\n * NB: This file is machine genera");
vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4376 2009-11-27 11");
vsb_cat(sb, ":06:32Z phk $\n *\n * NB: This file is machine genera");
vsb_cat(sb, "ted, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_t");
vsb_cat(sb, "oken.tcl instead\n */\n\nstruct sess;\n");
vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n");
......@@ -253,11 +253,8 @@ vcl_output_lang_h(struct vsb *sb)
vsb_cat(sb, "\tunsigned\t\t\tmax_connections;\n");
vsb_cat(sb, "\tunsigned\t\t\tsaintmode_threshold;\n");
vsb_cat(sb, "\tstruct vrt_backend_probe\tprobe;\n");
vsb_cat(sb, "};\n\n/*\n * A director with a predictable reply\n");
vsb_cat(sb, " */\n\nstruct vrt_dir_simple {\n");
vsb_cat(sb, "\tconst char\t\t\t\t*name;\n\tconst struct vrt_backend");
vsb_cat(sb, "\t\t*host;\n};\n\n/*\n * A director with an unpredicta");
vsb_cat(sb, "ble reply\n */\n\nstruct vrt_dir_random_entry {\n");
vsb_cat(sb, "};\n\n/*\n * A director with an unpredictable reply\n");
vsb_cat(sb, " */\n\nstruct vrt_dir_random_entry {\n");
vsb_cat(sb, "\tconst struct vrt_backend\t\t*host;\n");
vsb_cat(sb, "\tdouble\t\t\t\t\tweight;\n};\n");
vsb_cat(sb, "\nstruct vrt_dir_random {\n\tconst char\t\t\t\t*name;\n");
......@@ -302,7 +299,7 @@ vcl_output_lang_h(struct vsb *sb)
vsb_cat(sb, "ss *sp, unsigned flags, const char *, ...);\n");
vsb_cat(sb, "\n/* Backend related */\nvoid VRT_init_dir_simple(stru");
vsb_cat(sb, "ct cli *, struct director **,\n");
vsb_cat(sb, " const struct vrt_dir_simple *);\n");
vsb_cat(sb, " const struct vrt_backend *);\n");
vsb_cat(sb, "void VRT_init_dir_random(struct cli *, struct director");
vsb_cat(sb, " **,\n const struct vrt_dir_random *);\n");
vsb_cat(sb, "void VRT_init_dir_round_robin(struct cli *, struct dir");
......@@ -318,8 +315,8 @@ vcl_output_lang_h(struct vsb *sb)
/* ../../include/vrt_obj.h */
vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4358 2009-11-19 19");
vsb_cat(sb, ":03:25Z phk $\n *\n * NB: This file is machine genera");
vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4376 2009-11-27 11");
vsb_cat(sb, ":06:32Z phk $\n *\n * NB: This file is machine genera");
vsb_cat(sb, "ted, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_t");
vsb_cat(sb, "oken.tcl instead\n */\n\nstruct sockaddr * VRT_r_clien");
vsb_cat(sb, "t_ip(const struct sess *);\nstruct sockaddr * VRT_r_se");
......
/*
* $Id: vcc_gen_fixed_token.tcl 4358 2009-11-19 19:03:25Z phk $
* $Id: vcc_gen_fixed_token.tcl 4376 2009-11-27 11:06:32Z phk $
*
* NB: This file is machine generated, DO NOT EDIT!
*
......
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