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

phk at projects.linpro.no phk at projects.linpro.no
Mon Jul 2 15:08:07 CEST 2007


Author: phk
Date: 2007-07-02 15:08:07 +0200 (Mon, 02 Jul 2007)
New Revision: 1612

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_vcc.c
   trunk/varnish-cache/include/vcl.h
   trunk/varnish-cache/include/vcl_returns.h
   trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
   trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
Log:
Add vcl_deliver() method where touch-up's to the returned reply can
be performed.


Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2007-07-02 12:33:22 UTC (rev 1611)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2007-07-02 13:08:07 UTC (rev 1612)
@@ -127,6 +127,9 @@
     "    }\n"
     "    insert;\n"
     "}\n"
+    "sub vcl_deliver {\n"
+    "    deliver;\n"
+    "}\n"
     "sub vcl_discard {\n"
     "    discard;\n"
     "}\n"

Modified: trunk/varnish-cache/include/vcl.h
===================================================================
--- trunk/varnish-cache/include/vcl.h	2007-07-02 12:33:22 UTC (rev 1611)
+++ trunk/varnish-cache/include/vcl.h	2007-07-02 13:08:07 UTC (rev 1612)
@@ -38,6 +38,7 @@
 	vcl_func_f	*miss_func;
 	vcl_func_f	*hit_func;
 	vcl_func_f	*fetch_func;
+	vcl_func_f	*deliver_func;
 	vcl_func_f	*timeout_func;
 	vcl_func_f	*discard_func;
 };

Modified: trunk/varnish-cache/include/vcl_returns.h
===================================================================
--- trunk/varnish-cache/include/vcl_returns.h	2007-07-02 12:33:22 UTC (rev 1611)
+++ trunk/varnish-cache/include/vcl_returns.h	2007-07-02 13:08:07 UTC (rev 1612)
@@ -41,6 +41,7 @@
 VCL_MET_MAC(miss,MISS,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_FETCH))
 VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_DELIVER))
 VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_INSERT))
+VCL_MET_MAC(deliver,DELIVER,(VCL_RET_ERROR|VCL_RET_DELIVER))
 VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD))
 VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_KEEP))
 #else
@@ -51,7 +52,8 @@
 #define VCL_MET_MISS	(1 << 4)
 #define VCL_MET_HIT	(1 << 5)
 #define VCL_MET_FETCH	(1 << 6)
-#define VCL_MET_TIMEOUT	(1 << 7)
-#define VCL_MET_DISCARD	(1 << 8)
+#define VCL_MET_DELIVER	(1 << 7)
+#define VCL_MET_TIMEOUT	(1 << 8)
+#define VCL_MET_DISCARD	(1 << 9)
 #endif
-#define N_METHODS 9
+#define N_METHODS 10

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2007-07-02 12:33:22 UTC (rev 1611)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2007-07-02 13:08:07 UTC (rev 1612)
@@ -350,6 +350,7 @@
 	vsb_cat(sb, "	vcl_func_f	*miss_func;\n");
 	vsb_cat(sb, "	vcl_func_f	*hit_func;\n");
 	vsb_cat(sb, "	vcl_func_f	*fetch_func;\n");
+	vsb_cat(sb, "	vcl_func_f	*deliver_func;\n");
 	vsb_cat(sb, "	vcl_func_f	*timeout_func;\n");
 	vsb_cat(sb, "	vcl_func_f	*discard_func;\n");
 	vsb_cat(sb, "};\n");
@@ -453,29 +454,17 @@
 	vsb_cat(sb, " * Edit vcc_gen_obj.tcl instead\n");
 	vsb_cat(sb, " */\n");
 	vsb_cat(sb, "\n");
-	vsb_cat(sb, "const char * VRT_r_backend_host(struct backend *);\n");
 	vsb_cat(sb, "void VRT_l_backend_host(struct backend *, const char *);\n");
-	vsb_cat(sb, "const char * VRT_r_backend_port(struct backend *);\n");
 	vsb_cat(sb, "void VRT_l_backend_port(struct backend *, const char *);\n");
-	vsb_cat(sb, "double VRT_r_backend_dnsttl(struct backend *);\n");
 	vsb_cat(sb, "void VRT_l_backend_dnsttl(struct backend *, double);\n");
 	vsb_cat(sb, "struct sockaddr * VRT_r_client_ip(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_client_ip(struct sess *, struct sockaddr *);\n");
 	vsb_cat(sb, "struct sockaddr * VRT_r_server_ip(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_server_ip(struct sess *, struct sockaddr *);\n");
 	vsb_cat(sb, "const char * VRT_r_req_request(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_req_request(struct sess *, const char *);\n");
-	vsb_cat(sb, "const char * VRT_r_req_host(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_req_host(struct sess *, const char *);\n");
 	vsb_cat(sb, "const char * VRT_r_req_url(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_req_url(struct sess *, const char *);\n");
 	vsb_cat(sb, "const char * VRT_r_req_proto(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_req_proto(struct sess *, const char *);\n");
 	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, "const char * VRT_r_req_http_(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_req_http_(struct sess *, const char *);\n");
-	vsb_cat(sb, "const char * VRT_r_req_hash(struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_req_hash(struct sess *, const char *);\n");
 	vsb_cat(sb, "unsigned VRT_r_obj_valid(struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_obj_valid(struct sess *, unsigned);\n");
@@ -484,11 +473,7 @@
 	vsb_cat(sb, "double VRT_r_obj_ttl(struct sess *);\n");
 	vsb_cat(sb, "void VRT_l_obj_ttl(struct sess *, double);\n");
 	vsb_cat(sb, "const char * VRT_r_resp_proto(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_resp_proto(struct sess *, const char *);\n");
 	vsb_cat(sb, "int VRT_r_resp_status(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_resp_status(struct sess *, int);\n");
 	vsb_cat(sb, "const char * VRT_r_resp_response(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_resp_response(struct sess *, const char *);\n");
 	vsb_cat(sb, "const char * VRT_r_resp_http_(struct sess *);\n");
-	vsb_cat(sb, "void VRT_l_resp_http_(struct sess *, const char *);\n");
 }

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2007-07-02 12:33:22 UTC (rev 1611)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2007-07-02 13:08:07 UTC (rev 1612)
@@ -41,6 +41,7 @@
 	{miss		{error pass fetch}}
 	{hit		{error pass deliver}}
 	{fetch		{error pass insert}}
+	{deliver	{error deliver}}
 	{timeout	{fetch discard}}
 	{discard	{discard keep}}
 }




More information about the varnish-commit mailing list