From 8c84c4f141e5170f76dbc05d285a69169d03dbde Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 31 Jul 2008 22:38:01 +0000 Subject: [PATCH] Rename the vcl_fetch{} action "insert" to "deliver" as we may not insert (for instance on pass) but we certainly will deliver (unless error or restart actions are used instead). Update the dotgraph to 2.0 intent git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3048 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_center.c | 57 ++++++++++++------- varnish-cache/bin/varnishd/mgt_vcc.c | 2 +- varnish-cache/include/vcl_returns.h | 26 ++++----- varnish-cache/lib/libvcl/vcc_fixed_token.c | 11 ++-- .../lib/libvcl/vcc_gen_fixed_token.tcl | 7 +-- 5 files changed, 55 insertions(+), 48 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 3b789778..797df2d2 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -53,6 +53,7 @@ DOT shape=hexagon DOT label="Request received" DOT ] DOT ERROR [shape=plaintext] +DOT RESTART [shape=plaintext] DOT acceptor -> start [style=bold,color=green,weight=4] */ @@ -122,12 +123,14 @@ DOT label="vcl_deliver()|resp." DOT ] DOT deliver2 [ DOT shape=ellipse -DOT label="Send hdr + object" +DOT label="Send resp + body" DOT ] DOT deliver -> vcl_deliver [style=bold,color=green,weight=4] DOT vcl_deliver -> deliver2 [style=bold,color=green,weight=4,label=deliver] DOT vcl_deliver -> errdeliver [label="error"] DOT errdeliver [label="ERROR",shape=plaintext] +DOT vcl_deliver -> rstdeliver [label="restart",color=purple] +DOT rstdeliver [label="RESTART",shape=plaintext] DOT } DOT deliver2 -> DONE [style=bold,color=green,weight=4] * @@ -289,13 +292,13 @@ cnt_done(struct sess *sp) * Emit an error * DOT subgraph xcluster_error { -DOT error [ -DOT shape=ellipse -DOT label="Issue HTTP error" +DOT vcl_error [ +DOT shape=record +DOT label="vcl_error()|resp." DOT ] -DOT ERROR -> error +DOT ERROR -> vcl_error +DOT vcl_error-> deliver [label=deliver] DOT } -DOT error -> DONE */ static int @@ -359,11 +362,14 @@ DOT fetch_pass [ DOT shape=ellipse DOT label="obj.pass=true" DOT ] -DOT vcl_fetch -> fetch_pass [label="pass"] +DOT vcl_fetch -> fetch_pass [label="pass",style=bold,color=red] DOT } -DOT fetch_pass -> deliver -DOT vcl_fetch -> deliver [label="insert",style=bold,color=blue,weight=2] +DOT fetch_pass -> deliver [style=bold,color=red] +DOT vcl_fetch -> deliver [label="deliver",style=bold,color=blue,weight=2] DOT vcl_fetch -> recv [label="restart"] +DOT vcl_fetch -> rstfetch [label="restart",color=purple] +DOT rstfetch [label="RESTART",shape=plaintext] +DOT fetch -> errfetch DOT vcl_fetch -> errfetch [label="error"] DOT errfetch [label="ERROR",shape=plaintext] */ @@ -422,7 +428,7 @@ VSL(SLT_Debug, sp->fd, "Fetch = %d", i); case VCL_RET_PASS: sp->obj->pass = 1; break; - case VCL_RET_INSERT: + case VCL_RET_DELIVER: break; default: INCOMPL(); @@ -499,7 +505,9 @@ DOT ] DOT } DOT hit -> err_hit [label="error"] DOT err_hit [label="ERROR",shape=plaintext] -DOT hit -> pass [label=pass] +DOT hit -> rst_hit [label="restart",color=purple] +DOT rst_hit [label="RESTART",shape=plaintext] +DOT hit -> pass [label=pass,style=bold,color=red] DOT hit -> deliver [label="deliver",style=bold,color=green,weight=4] */ @@ -564,7 +572,7 @@ DOT hash -> lookup [label="hash",style=bold,color=green,weight=4] DOT lookup -> lookup2 [label="yes",style=bold,color=green,weight=4] DOT } DOT lookup2 -> hit [label="no", style=bold,color=green,weight=4] -DOT lookup2 -> pass [label="yes"] +DOT lookup2 -> pass [label="yes",style=bold,color=red] DOT lookup -> miss [label="no",style=bold,color=blue,weight=2] */ @@ -658,10 +666,12 @@ DOT label="vcl_miss()|req.\nbereq." DOT ] DOT miss -> vcl_miss [style=bold,color=blue,weight=2] DOT } +DOT vcl_miss -> rst_miss [label="restart",color=purple] +DOT rst_miss [label="RESTART",shape=plaintext] DOT vcl_miss -> err_miss [label="error"] DOT err_miss [label="ERROR",shape=plaintext] DOT vcl_miss -> fetch [label="fetch",style=bold,color=blue,weight=2] -DOT vcl_miss -> pass [label="pass"] +DOT vcl_miss -> pass [label="pass",style=bold,color=red] DOT */ @@ -725,11 +735,13 @@ DOT pass_do [ DOT shape=ellipse DOT label="create anon object\n" DOT ] -DOT pass -> pass2 -DOT pass2 -> vcl_pass -DOT vcl_pass -> pass_do [label="pass"] +DOT pass -> pass2 [style=bold, color=red] +DOT pass2 -> vcl_pass [style=bold, color=red] +DOT vcl_pass -> pass_do [label="pass"] [style=bold, color=red] DOT } -DOT pass_do -> fetch +DOT pass_do -> fetch [style=bold, color=red] +DOT vcl_pass -> rst_pass [label="restart",color=purple] +DOT rst_pass [label="RESTART",shape=plaintext] DOT vcl_pass -> err_pass [label="error"] DOT err_pass [label="ERROR",shape=plaintext] */ @@ -776,10 +788,10 @@ DOT pipe_do [ DOT shape=ellipse DOT label="send bereq.\npipe until close" DOT ] -DOT vcl_pipe -> pipe_do [label="pipe"] -DOT pipe -> vcl_pipe +DOT vcl_pipe -> pipe_do [label="pipe",style=bold,color=orange] +DOT pipe -> vcl_pipe [style=bold,color=orange] DOT } -DOT pipe_do -> DONE +DOT pipe_do -> DONE [style=bold,color=orange] DOT vcl_pipe -> err_pipe [label="error"] DOT err_pipe [label="ERROR",shape=plaintext] */ @@ -816,8 +828,9 @@ DOT shape=record DOT label="vcl_recv()|req." DOT ] DOT } -DOT recv -> pipe [label="pipe"] -DOT recv -> pass2 [label="pass"] +DOT RESTART -> recv +DOT recv -> pipe [label="pipe",style=bold,color=orange] +DOT recv -> pass2 [label="pass",style=bold,color=red] DOT recv -> err_recv [label="error"] DOT err_recv [label="ERROR",shape=plaintext] DOT recv -> hash [label="lookup",style=bold,color=green,weight=4] diff --git a/varnish-cache/bin/varnishd/mgt_vcc.c b/varnish-cache/bin/varnishd/mgt_vcc.c index 6206bba3..2573a5a8 100644 --- a/varnish-cache/bin/varnishd/mgt_vcc.c +++ b/varnish-cache/bin/varnishd/mgt_vcc.c @@ -142,7 +142,7 @@ static const char *default_vcl = " pass;\n" " }\n" " set obj.prefetch = -30s;" - " insert;\n" + " deliver;\n" "}\n" "sub vcl_deliver {\n" " deliver;\n" diff --git a/varnish-cache/include/vcl_returns.h b/varnish-cache/include/vcl_returns.h index 8359ecab..318f27b9 100644 --- a/varnish-cache/include/vcl_returns.h +++ b/varnish-cache/include/vcl_returns.h @@ -15,11 +15,10 @@ VCL_RET_MAC(hash, HASH, (1 << 2), 2) VCL_RET_MAC(pipe, PIPE, (1 << 3), 3) VCL_RET_MAC(pass, PASS, (1 << 4), 4) VCL_RET_MAC(fetch, FETCH, (1 << 5), 5) -VCL_RET_MAC(insert, INSERT, (1 << 6), 6) -VCL_RET_MAC(deliver, DELIVER, (1 << 7), 7) -VCL_RET_MAC(discard, DISCARD, (1 << 8), 8) -VCL_RET_MAC(keep, KEEP, (1 << 9), 9) -VCL_RET_MAC(restart, RESTART, (1 << 10), 10) +VCL_RET_MAC(deliver, DELIVER, (1 << 6), 6) +VCL_RET_MAC(discard, DISCARD, (1 << 7), 7) +VCL_RET_MAC(keep, KEEP, (1 << 8), 8) +VCL_RET_MAC(restart, RESTART, (1 << 9), 9) #else #define VCL_RET_ERROR (1 << 0) #define VCL_RET_LOOKUP (1 << 1) @@ -27,22 +26,21 @@ VCL_RET_MAC(restart, RESTART, (1 << 10), 10) #define VCL_RET_PIPE (1 << 3) #define VCL_RET_PASS (1 << 4) #define VCL_RET_FETCH (1 << 5) -#define VCL_RET_INSERT (1 << 6) -#define VCL_RET_DELIVER (1 << 7) -#define VCL_RET_DISCARD (1 << 8) -#define VCL_RET_KEEP (1 << 9) -#define VCL_RET_RESTART (1 << 10) -#define VCL_RET_MAX 11 +#define VCL_RET_DELIVER (1 << 6) +#define VCL_RET_DISCARD (1 << 7) +#define VCL_RET_KEEP (1 << 8) +#define VCL_RET_RESTART (1 << 9) +#define VCL_RET_MAX 10 #endif #ifdef VCL_MET_MAC -VCL_MET_MAC(recv,RECV,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_LOOKUP)) -VCL_MET_MAC(pipe,PIPE,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PIPE)) +VCL_MET_MAC(recv,RECV,(VCL_RET_ERROR|VCL_RET_PASS|VCL_RET_PIPE|VCL_RET_LOOKUP)) +VCL_MET_MAC(pipe,PIPE,(VCL_RET_ERROR|VCL_RET_PIPE)) VCL_MET_MAC(pass,PASS,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS)) VCL_MET_MAC(hash,HASH,(VCL_RET_HASH)) VCL_MET_MAC(miss,MISS,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_FETCH)) VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_DELIVER)) -VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_INSERT)) +VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_DELIVER)) VCL_MET_MAC(deliver,DELIVER,(VCL_RET_RESTART|VCL_RET_DELIVER)) VCL_MET_MAC(prefetch,PREFETCH,(VCL_RET_FETCH|VCL_RET_PASS)) VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD)) diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index 00fb1e47..5ab48e4d 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -225,11 +225,10 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, "#define VCL_RET_PIPE (1 << 3)\n"); vsb_cat(sb, "#define VCL_RET_PASS (1 << 4)\n"); vsb_cat(sb, "#define VCL_RET_FETCH (1 << 5)\n"); - vsb_cat(sb, "#define VCL_RET_INSERT (1 << 6)\n"); - vsb_cat(sb, "#define VCL_RET_DELIVER (1 << 7)\n"); - vsb_cat(sb, "#define VCL_RET_DISCARD (1 << 8)\n"); - vsb_cat(sb, "#define VCL_RET_KEEP (1 << 9)\n"); - vsb_cat(sb, "#define VCL_RET_RESTART (1 << 10)\n"); + vsb_cat(sb, "#define VCL_RET_DELIVER (1 << 6)\n"); + vsb_cat(sb, "#define VCL_RET_DISCARD (1 << 7)\n"); + vsb_cat(sb, "#define VCL_RET_KEEP (1 << 8)\n"); + vsb_cat(sb, "#define VCL_RET_RESTART (1 << 9)\n"); vsb_cat(sb, "/*\n"); vsb_cat(sb, " * $Id$\n"); vsb_cat(sb, " *\n"); @@ -487,8 +486,6 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, "void VRT_l_obj_status(const struct sess *, int);\n"); vsb_cat(sb, "const char * VRT_r_obj_response(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_obj_response(const struct sess *, const char *, ...);\n"); - vsb_cat(sb, "unsigned VRT_r_obj_valid(const struct sess *);\n"); - vsb_cat(sb, "void VRT_l_obj_valid(const struct sess *, unsigned);\n"); vsb_cat(sb, "unsigned VRT_r_obj_cacheable(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_obj_cacheable(const struct sess *, unsigned);\n"); vsb_cat(sb, "double VRT_r_obj_ttl(const struct sess *);\n"); diff --git a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl index 0f10b4a8..050587c0 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl @@ -34,13 +34,13 @@ # Second element is list of valid return actions. # set methods { - {recv {error restart pass pipe lookup}} - {pipe {error restart pipe}} + {recv {error pass pipe lookup}} + {pipe {error pipe}} {pass {error restart pass}} {hash {hash}} {miss {error restart pass fetch}} {hit {error restart pass deliver}} - {fetch {error restart pass insert}} + {fetch {error restart pass deliver}} {deliver {restart deliver}} {prefetch {fetch pass}} {timeout {fetch discard}} @@ -57,7 +57,6 @@ set returns { pipe pass fetch - insert deliver discard keep -- 2.39.5