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

phk at projects.linpro.no phk at projects.linpro.no
Tue Aug 18 11:17:22 CEST 2009


Author: phk
Date: 2009-08-18 11:17:21 +0200 (Tue, 18 Aug 2009)
New Revision: 4190

Modified:
   trunk/varnish-cache/include/vrt_obj.h
   trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
   trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
   trunk/varnish-cache/lib/libvcl/vcc_obj.c
Log:
Clean up the vcc generator script a little bit



Modified: trunk/varnish-cache/include/vrt_obj.h
===================================================================
--- trunk/varnish-cache/include/vrt_obj.h	2009-08-18 08:45:41 UTC (rev 4189)
+++ trunk/varnish-cache/include/vrt_obj.h	2009-08-18 09:17:21 UTC (rev 4190)
@@ -26,6 +26,7 @@
 const char * VRT_r_req_xid(struct sess *);
 unsigned VRT_r_req_esi(struct sess *);
 void VRT_l_req_esi(struct sess *, unsigned);
+unsigned VRT_r_req_backend_healthy(const struct sess *);
 const char * VRT_r_bereq_request(const struct sess *);
 void VRT_l_bereq_request(const struct sess *, const char *, ...);
 const char * VRT_r_bereq_url(const struct sess *);
@@ -72,4 +73,3 @@
 const char * VRT_r_resp_response(const struct sess *);
 void VRT_l_resp_response(const struct sess *, const char *, ...);
 double VRT_r_now(const struct sess *);
-unsigned VRT_r_req_backend_healthy(const struct sess *);

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2009-08-18 08:45:41 UTC (rev 4189)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2009-08-18 09:17:21 UTC (rev 4190)
@@ -1,5 +1,5 @@
 /*
- * $Id: vcc_gen_fixed_token.tcl 4100 2009-06-09 10:41:38Z phk $
+ * $Id: vcc_gen_fixed_token.tcl 4188 2009-08-18 08:29:27Z 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 4100 2009-06-09 10");
-	vsb_cat(sb, ":41:38Z phk $\n *\n * NB:  This file is machine genera");
+	vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4188 2009-08-18 08");
+	vsb_cat(sb, ":29:27Z 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");
@@ -317,8 +317,8 @@
 
 	/* ../../include/vrt_obj.h */
 
-	vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4100 2009-06-09 10");
-	vsb_cat(sb, ":41:38Z phk $\n *\n * NB:  This file is machine genera");
+	vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4188 2009-08-18 08");
+	vsb_cat(sb, ":29:27Z 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");
@@ -340,13 +340,14 @@
 	vsb_cat(sb, "const char * VRT_r_req_xid(struct sess *);\n");
 	vsb_cat(sb, "unsigned VRT_r_req_esi(struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_req_esi(struct sess *, unsigned);\n");
-	vsb_cat(sb, "const char * VRT_r_bereq_request(const struct sess *);");
-	vsb_cat(sb, "\nvoid VRT_l_bereq_request(const struct sess *, const ");
-	vsb_cat(sb, "char *, ...);\nconst char * VRT_r_bereq_url(const stru");
-	vsb_cat(sb, "ct sess *);\nvoid VRT_l_bereq_url(const struct sess *,");
-	vsb_cat(sb, " const char *, ...);\nconst char * VRT_r_bereq_proto(c");
-	vsb_cat(sb, "onst struct sess *);\nvoid VRT_l_bereq_proto(const str");
-	vsb_cat(sb, "uct sess *, const char *, ...);\n");
+	vsb_cat(sb, "unsigned VRT_r_req_backend_healthy(const struct sess *");
+	vsb_cat(sb, ");\nconst char * VRT_r_bereq_request(const struct sess");
+	vsb_cat(sb, " *);\nvoid VRT_l_bereq_request(const struct sess *, co");
+	vsb_cat(sb, "nst char *, ...);\nconst char * VRT_r_bereq_url(const ");
+	vsb_cat(sb, "struct sess *);\nvoid VRT_l_bereq_url(const struct ses");
+	vsb_cat(sb, "s *, const char *, ...);\nconst char * VRT_r_bereq_pro");
+	vsb_cat(sb, "to(const struct sess *);\nvoid VRT_l_bereq_proto(const");
+	vsb_cat(sb, " struct sess *, const char *, ...);\n");
 	vsb_cat(sb, "double VRT_r_bereq_connect_timeout(struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_bereq_connect_timeout(struct sess *, double");
 	vsb_cat(sb, ");\ndouble VRT_r_bereq_first_byte_timeout(struct sess ");
@@ -388,6 +389,4 @@
 	vsb_cat(sb, "const char * VRT_r_resp_response(const struct sess *);");
 	vsb_cat(sb, "\nvoid VRT_l_resp_response(const struct sess *, const ");
 	vsb_cat(sb, "char *, ...);\ndouble VRT_r_now(const struct sess *);\n");
-	vsb_cat(sb, "unsigned VRT_r_req_backend_healthy(const struct sess *");
-	vsb_cat(sb, ");\n");
 }

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2009-08-18 08:45:41 UTC (rev 4189)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2009-08-18 09:17:21 UTC (rev 4190)
@@ -87,253 +87,254 @@
 set spobj {
 
     # Connection related parameters
-    { client.ip
-	RO IP
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { client.ip				IP
+	RO
+	all
 	"const struct sess *"
     }
-    { server.ip
-	RO IP
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { server.ip				IP
+	RO
+	all
 	"struct sess *"
     }
-    { server.hostname
-	RO STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { server.hostname			STRING
+	RO
+	all
 	"struct sess *"
     }
-    { server.identity
-	RO STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { server.identity			STRING
+	RO
+	all
 	"struct sess *"
     }
-    { server.port
-	RO INT
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { server.port			INT
+	RO
+	all
 	"struct sess *"
     }
     # Request paramters
-    { req.request
-	RW STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { req.request			STRING
+	RW
+	all
 	"const struct sess *"
     }
-    { req.url
-	RW STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { req.url				STRING
+	RW
+	all
 	"const struct sess *"
     }
-    { req.proto
-	RW STRING
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { req.proto				STRING
+	RW
+	all
 	"const struct sess *"
     }
-    { req.http.
-	RW HDR_REQ
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { req.http.				HDR_REQ
+	RW
+	all
 	"const struct sess *"
     }
 
     # Possibly misnamed, not really part of the request
-    { req.hash
-	WO HASH
-	{               hash                                       error }
+    { req.hash				HASH
+	WO
+	{ hash error }
 	"struct sess *"
     }
-    { req.backend
-	RW BACKEND
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { req.backend			BACKEND
+	RW
+	all
 	"struct sess *"
     }
-    { req.restarts
-	RO INT
-	{recv pipe pass hash miss hit fetch deliver                error }
+    { req.restarts			INT
+	RO
+	all
 	"const struct sess *"
     }
-    { req.grace
-	RW TIME
-	{recv pipe pass hash miss hit fetch deliver		   error }
+    { req.grace				TIME
+	RW
+	all
 	"struct sess *"
     }
 
-    { req.xid
-	RO STRING
-	{recv pipe pass hash miss hit fetch deliver		   error}
+    { req.xid				STRING
+	RO
+	all
 	"struct sess *"
     }
 
-    { req.esi
-	RW BOOL
-	{recv fetch deliver					   error}
+    { req.esi				BOOL
+	RW
+	{recv fetch deliver error }
 	"struct sess *"
     }
 
+    { req.backend.healthy		BOOL
+	RO
+	all
+	"const struct sess *"
+    }
+
     #######################################################################
     # Request sent to backend
-    { bereq.request
-	RW STRING
-	{     pipe pass      miss     fetch                        }
+    { bereq.request			STRING
+	RW
+	{ pipe pass miss fetch }
 	"const struct sess *"
     }
-    { bereq.url
-	RW STRING
-	{     pipe pass      miss     fetch                        }
+    { bereq.url				STRING
+	RW
+	{ pipe pass miss fetch }
 	"const struct sess *"
     }
-    { bereq.proto
-	RW STRING
-	{     pipe pass      miss     fetch                        }
+    { bereq.proto			STRING
+	RW
+	{ pipe pass miss fetch }
 	"const struct sess *"
     }
-    { bereq.http.
-	RW HDR_BEREQ
-	{     pipe pass      miss     fetch                        }
+    { bereq.http.			HDR_BEREQ
+	RW
+	{ pipe pass miss fetch }
 	"const struct sess *"
     }
-    { bereq.connect_timeout
-	RW TIME
-	{     pass      miss     }
+    { bereq.connect_timeout		TIME
+	RW
+	{ pass miss }
 	"struct sess *"
     }
-    { bereq.first_byte_timeout
-	RW TIME
-	{     pass      miss     }
+    { bereq.first_byte_timeout		TIME
+	RW
+	{ pass miss }
 	"struct sess *"
     }
-    { bereq.between_bytes_timeout
-	RW TIME
-	{     pass      miss     }
+    { bereq.between_bytes_timeout	TIME
+	RW
+	{ pass miss }
 	"struct sess *"
     }
 
     #######################################################################
     # Response from the backend
-    { beresp.proto
-	RW STRING
-	{                             fetch                        }
+    { beresp.proto			STRING
+	RW
+	{ fetch }
 	"const struct sess *"
     }
-    { beresp.status
-	RW INT
-	{                             fetch                        }
+    { beresp.status			INT
+	RW
+	{ fetch }
 	"const struct sess *"
     }
-    { beresp.response
-	RW STRING
-	{                             fetch                        }
+    { beresp.response			STRING
+	RW
+	{ fetch }
 	"const struct sess *"
     }
-    { beresp.http.
-	RW HDR_BERESP
-	{                             fetch                        }
+    { beresp.http.			HDR_BERESP
+	RW
+	{ fetch }
 	"const struct sess *"
     }
-    { beresp.cacheable
-	RW BOOL
-	{                             fetch                              }
+    { beresp.cacheable			BOOL
+	RW
+	{ fetch }
 	"const struct sess *"
     }
-    { beresp.ttl
-	RW TIME
-	{                             fetch				 }
+    { beresp.ttl			TIME
+	RW
+	{ fetch }
 	"const struct sess *"
     }
-    { beresp.grace
-	RW TIME
-	{                             fetch				 }
+    { beresp.grace			TIME
+	RW
+	{ fetch }
 	"const struct sess *"
     }
 
     #######################################################################
     # The (possibly) cached object
-    { obj.proto
-	RW STRING
-	{                         hit                               error}
+    { obj.proto				STRING
+	RW 
+	{ hit error }
 	"const struct sess *"
     }
-    { obj.status
-	RW INT
-	{                                                           error}
+    { obj.status			INT
+	RW 
+	{ error }
 	"const struct sess *"
     }
-    { obj.response
-	RW STRING
-	{                                                           error}
+    { obj.response			STRING
+	RW
+	{ error }
 	"const struct sess *"
     }
-    { obj.hits
-	RO INT
-	{			  hit       deliver                      }
+    { obj.hits				INT
+	RO
+	{ hit deliver }
 	"const struct sess *"
     }
-    { obj.http.
-	RW HDR_OBJ
-	{                         hit       			    error}
+    { obj.http.				HDR_OBJ
+	RW
+	{ hit error }
 	"const struct sess *"
     }
 
-    { obj.cacheable
-	RW BOOL
-	{                         hit                                    }
+    { obj.cacheable			BOOL
+	RW
+	{ hit }
 	"const struct sess *"
     }
-    { obj.ttl
-	RW TIME
-	{                         hit               error}
+    { obj.ttl				TIME
+	RW
+	{ hit error }
 	"const struct sess *"
     }
-    { obj.grace
-	RW TIME
-	{                         hit               error}
+    { obj.grace				TIME
+	RW
+	{ hit error }
 	"const struct sess *"
     }
-    { obj.lastuse
-	RO TIME
-	{                         hit       deliver error}
+    { obj.lastuse			TIME
+	RO
+	{ hit deliver error }
 	"const struct sess *"
     }
-    { obj.hash
-	RO STRING
-	{                    miss hit       deliver                 error}
+    { obj.hash				STRING
+	RO
+	{ miss hit deliver error }
 	"const struct sess *"
     }
 
     #######################################################################
     # The response we send back
-    { resp.proto
-	RW STRING
-	{                                   deliver                }
+    { resp.proto			STRING
+	RW
+	{ deliver }
 	"const struct sess *"
     }
-    { resp.status
-	RW INT
-	{                                   deliver                }
+    { resp.status			INT
+	RW
+	{ deliver }
 	"const struct sess *"
     }
-    { resp.response
-	RW STRING
-	{                                   deliver                }
+    { resp.response			STRING
+	RW
+	{ deliver }
 	"const struct sess *"
     }
-    { resp.http.
-	RW HDR_RESP
-	{                                   deliver                }
+    { resp.http.			HDR_RESP
+	RW
+	{ deliver }
 	"const struct sess *"
     }
 
     # Miscellaneous
     # XXX: I'm not happy about this one.  All times should be relative
     # XXX: or delta times in VCL programs, so this shouldn't be needed /phk
-    { now
-	    RO TIME
-	    {recv pipe pass hash miss hit fetch deliver }
-	    "const struct sess *"
+    { now				TIME
+	RO
+	all
+	"const struct sess *"
     }
-    { req.backend.healthy	RO BOOL
-	    {recv pipe pass hash miss hit fetch deliver }
-	    "const struct sess *"
-    }
-
 }
 
 set tt(IP)		"struct sockaddr *"
@@ -433,7 +434,14 @@
 warns $fp
 
 proc method_map {m} {
+	global methods
 
+	if {$m == "all"} {
+		set m ""
+		foreach i $methods {
+			lappend m [lindex $i 0]
+		}
+	}
 	set l1 ""
 	set l2 ""
 	foreach i $m {
@@ -468,9 +476,9 @@
 	foreach v $v {
 		set n [lindex $v 0]
 		regsub -all {[.]} $n "_" m
-		set a [lindex $v 1]
+		set t [lindex $v 1]
+		set a [lindex $v 2]
 		if {$a == "NO"} continue
-		set t [lindex $v 2]
 		set ty [lindex $v 4]
 		if {[regexp HDR_ $t]} {
 			puts $fo  "\t\{ \"$n\", HEADER, [string length $n],"

Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_obj.c	2009-08-18 08:45:41 UTC (rev 4189)
+++ trunk/varnish-cache/lib/libvcl/vcc_obj.c	2009-08-18 09:17:21 UTC (rev 4190)
@@ -1,5 +1,5 @@
 /*
- * $Id: vcc_gen_fixed_token.tcl 4100 2009-06-09 10:41:38Z phk $
+ * $Id: vcc_gen_fixed_token.tcl 4188 2009-08-18 08:29:27Z phk $
  *
  * NB:  This file is machine generated, DO NOT EDIT!
  *
@@ -112,6 +112,13 @@
 	    V_RW,	    0,
 	    VCL_MET_RECV | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR
 	},
+	{ "req.backend.healthy", BOOL, 19,
+	    "VRT_r_req_backend_healthy(sp)",	    NULL,
+	    V_RO,	    0,
+	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
+	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
+	     | VCL_MET_ERROR
+	},
 	{ "bereq.request", STRING, 13,
 	    "VRT_r_bereq_request(sp)",	    "VRT_l_bereq_request(sp, ",
 	    V_RW,	    0,
@@ -257,12 +264,7 @@
 	    V_RO,	    0,
 	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
 	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
+	     | VCL_MET_ERROR
 	},
-	{ "req.backend.healthy", BOOL, 19,
-	    "VRT_r_req_backend_healthy(sp)",	    NULL,
-	    V_RO,	    0,
-	    VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
-	     | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
-	},
 	{ NULL }
 };



More information about the varnish-commit mailing list