r4391 - in trunk/varnish-cache: bin/varnishd include lib/libvcl

phk at projects.linpro.no phk at projects.linpro.no
Mon Dec 14 13:10:15 CET 2009


Author: phk
Date: 2009-12-14 13:10:15 +0100 (Mon, 14 Dec 2009)
New Revision: 4391

Modified:
   trunk/varnish-cache/bin/varnishd/cache_dir_simple.c
   trunk/varnish-cache/include/vrt.h
   trunk/varnish-cache/lib/libvcl/vcc_backend.c
   trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
   trunk/varnish-cache/lib/libvcl/vcc_obj.c
Log:
Eliminate the vrt_dir_simple structure, it is not really needed.



Modified: trunk/varnish-cache/bin/varnishd/cache_dir_simple.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_simple.c	2009-12-14 11:41:57 UTC (rev 4390)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_simple.c	2009-12-14 12:10:15 UTC (rev 4391)
@@ -95,7 +95,7 @@
 
 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 @@
 	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;
 }

Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h	2009-12-14 11:41:57 UTC (rev 4390)
+++ trunk/varnish-cache/include/vrt.h	2009-12-14 12:10:15 UTC (rev 4391)
@@ -79,15 +79,6 @@
 };
 
 /*
- * 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 @@
 
 /* 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 **,

Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_backend.c	2009-12-14 11:41:57 UTC (rev 4390)
+++ trunk/varnish-cache/lib/libvcl/vcc_backend.c	2009-12-14 12:10:15 UTC (rev 4391)
@@ -747,16 +747,10 @@
 	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");
-
 }
 
 /*--------------------------------------------------------------------

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2009-12-14 11:41:57 UTC (rev 4390)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2009-12-14 12:10:15 UTC (rev 4391)
@@ -1,5 +1,5 @@
 /*
- * $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 @@
 
 	/* ../../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 @@
 	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 @@
 	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 @@
 
 	/* ../../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");

Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_obj.c	2009-12-14 11:41:57 UTC (rev 4390)
+++ trunk/varnish-cache/lib/libvcl/vcc_obj.c	2009-12-14 12:10:15 UTC (rev 4391)
@@ -1,5 +1,5 @@
 /*
- * $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!
  *



More information about the varnish-commit mailing list