r2420 - in trunk/varnish-cache: include lib/libvcl

phk at projects.linpro.no phk at projects.linpro.no
Mon Feb 4 10:26:36 CET 2008


Author: phk
Date: 2008-02-04 10:26:36 +0100 (Mon, 04 Feb 2008)
New Revision: 2420

Modified:
   trunk/varnish-cache/include/vrt_obj.h
   trunk/varnish-cache/lib/libvcl/vcc_compile.c
   trunk/varnish-cache/lib/libvcl/vcc_compile.h
   trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
   trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl
   trunk/varnish-cache/lib/libvcl/vcc_obj.c
Log:
GC support code for the old backend specification code.


Modified: trunk/varnish-cache/include/vrt_obj.h
===================================================================
--- trunk/varnish-cache/include/vrt_obj.h	2008-02-03 22:27:15 UTC (rev 2419)
+++ trunk/varnish-cache/include/vrt_obj.h	2008-02-04 09:26:36 UTC (rev 2420)
@@ -6,10 +6,6 @@
  * Edit vcc_gen_obj.tcl instead
  */
 
-void VRT_l_backend_host(struct backend *, const char *);
-void VRT_l_backend_port(struct backend *, const char *);
-void VRT_l_backend_dnsttl(struct backend *, double);
-void VRT_l_backend_set(struct backend *, struct vrt_backend_entry *);
 struct sockaddr * VRT_r_client_ip(const struct sess *);
 struct sockaddr * VRT_r_server_ip(struct sess *);
 const char * VRT_r_req_request(const struct sess *);

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c	2008-02-03 22:27:15 UTC (rev 2419)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c	2008-02-04 09:26:36 UTC (rev 2420)
@@ -692,15 +692,10 @@
 void
 VCC_InitCompile(const char *default_vcl)
 {
-	struct var *v;
 
 	vcc_default_vcl_b = default_vcl;
 	vcc_default_vcl_e = strchr(default_vcl, '\0');
 	assert(vcc_default_vcl_e != NULL);
 
 	vcl_init_tnames();
-	for (v = vcc_vars; v->name != NULL; v++)
-		v->len = strlen(v->name);
-	for (v = vcc_be_vars; v->name != NULL; v++)
-		v->len = strlen(v->name);
 }

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.h	2008-02-03 22:27:15 UTC (rev 2419)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.h	2008-02-04 09:26:36 UTC (rev 2420)
@@ -106,11 +106,8 @@
 	RTIME,
 	STRING,
 	IP,
-	HOSTNAME,
-	PORTNAME,
 	HASH,
-	HEADER,
-	SET
+	HEADER
 };
 
 enum var_access {
@@ -177,7 +174,6 @@
 void *TlAlloc(struct tokenlist *tl, unsigned len);
 
 /* vcc_obj.c */
-extern struct var vcc_be_vars[];
 extern struct var vcc_vars[];
 
 /* vcc_parse.c */

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2008-02-03 22:27:15 UTC (rev 2419)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2008-02-04 09:26:36 UTC (rev 2420)
@@ -505,10 +505,6 @@
 	vsb_cat(sb, " * Edit vcc_gen_obj.tcl instead\n");
 	vsb_cat(sb, " */\n");
 	vsb_cat(sb, "\n");
-	vsb_cat(sb, "void VRT_l_backend_host(struct backend *, const char *);\n");
-	vsb_cat(sb, "void VRT_l_backend_port(struct backend *, const char *);\n");
-	vsb_cat(sb, "void VRT_l_backend_dnsttl(struct backend *, double);\n");
-	vsb_cat(sb, "void VRT_l_backend_set(struct backend *, struct vrt_backend_entry *);\n");
 	vsb_cat(sb, "struct sockaddr * VRT_r_client_ip(const struct sess *);\n");
 	vsb_cat(sb, "struct sockaddr * VRT_r_server_ip(struct sess *);\n");
 	vsb_cat(sb, "const char * VRT_r_req_request(const struct sess *);\n");
@@ -521,8 +517,8 @@
 	vsb_cat(sb, "struct backend * VRT_r_req_backend(struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_req_backend(struct sess *, struct backend *);\n");
 	vsb_cat(sb, "int VRT_r_req_restarts(const struct sess *);\n");
-	vsb_cat(sb, "double VRT_r_req_grace(const struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_req_grace(const struct sess *, double);\n");
+	vsb_cat(sb, "double VRT_r_req_grace(struct sess *);\n");
+	vsb_cat(sb, "void VRT_l_req_grace(struct sess *, double);\n");
 	vsb_cat(sb, "const char * VRT_r_bereq_request(const struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_bereq_request(const struct sess *, const char *, ...);\n");
 	vsb_cat(sb, "const char * VRT_r_bereq_url(const struct sess *);\n");

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl	2008-02-03 22:27:15 UTC (rev 2419)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl	2008-02-04 09:26:36 UTC (rev 2420)
@@ -30,13 +30,6 @@
 # Generate various .c and .h files for the VCL compiler and the interfaces
 # for it.
 
-# Objects available in backends
-set beobj {
-  { backend.host	WO HOSTNAME	{} "struct backend *"}
-  { backend.port	WO PORTNAME	{} "struct backend *"}
-  { backend.dnsttl	WO TIME		{} "struct backend *"}
-  { backend.set		WO SET		{} "struct backend *"}
-}
 
 # Variables available in sessions
 # Comments are stripped from #...\n
@@ -316,12 +309,6 @@
 puts $fo "#include \"vcc_compile.h\""
 puts $fo ""
 
-puts $fo "struct var vcc_be_vars\[\] = {"
-vars $beobj "backend"
-puts $fo "};"
-
-puts $fo ""
-
 puts $fo "struct var vcc_vars\[\] = {"
 vars $spobj "sp"
 puts $fo "};"

Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_obj.c	2008-02-03 22:27:15 UTC (rev 2419)
+++ trunk/varnish-cache/lib/libvcl/vcc_obj.c	2008-02-04 09:26:36 UTC (rev 2420)
@@ -9,38 +9,6 @@
 #include <stdio.h>
 #include "vcc_compile.h"
 
-struct var vcc_be_vars[] = {
-	{ "backend.host", HOSTNAME, 12,
-	    NULL,
-	    "VRT_l_backend_host(backend, ",
-	    V_WO,
-	    0,
-	    0
-	},
-	{ "backend.port", PORTNAME, 12,
-	    NULL,
-	    "VRT_l_backend_port(backend, ",
-	    V_WO,
-	    0,
-	    0
-	},
-	{ "backend.dnsttl", TIME, 14,
-	    NULL,
-	    "VRT_l_backend_dnsttl(backend, ",
-	    V_WO,
-	    0,
-	    0
-	},
-	{ "backend.set", SET, 11,
-	    NULL,
-	    "VRT_l_backend_set(backend, ",
-	    V_WO,
-	    0,
-	    0
-	},
-	{ NULL }
-};
-
 struct var vcc_vars[] = {
 	{ "client.ip", IP, 9,
 	    "VRT_r_client_ip(sp)",




More information about the varnish-commit mailing list