Commit 82a65af3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

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: http://www.varnish-cache.org/svn/trunk/varnish-cache@3048 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent c5c1af9b
...@@ -53,6 +53,7 @@ DOT shape=hexagon ...@@ -53,6 +53,7 @@ DOT shape=hexagon
DOT label="Request received" DOT label="Request received"
DOT ] DOT ]
DOT ERROR [shape=plaintext] DOT ERROR [shape=plaintext]
DOT RESTART [shape=plaintext]
DOT acceptor -> start [style=bold,color=green,weight=4] DOT acceptor -> start [style=bold,color=green,weight=4]
*/ */
...@@ -122,12 +123,14 @@ DOT label="vcl_deliver()|resp." ...@@ -122,12 +123,14 @@ DOT label="vcl_deliver()|resp."
DOT ] DOT ]
DOT deliver2 [ DOT deliver2 [
DOT shape=ellipse DOT shape=ellipse
DOT label="Send hdr + object" DOT label="Send resp + body"
DOT ] DOT ]
DOT deliver -> vcl_deliver [style=bold,color=green,weight=4] 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 -> deliver2 [style=bold,color=green,weight=4,label=deliver]
DOT vcl_deliver -> errdeliver [label="error"] DOT vcl_deliver -> errdeliver [label="error"]
DOT errdeliver [label="ERROR",shape=plaintext] DOT errdeliver [label="ERROR",shape=plaintext]
DOT vcl_deliver -> rstdeliver [label="restart",color=purple]
DOT rstdeliver [label="RESTART",shape=plaintext]
DOT } DOT }
DOT deliver2 -> DONE [style=bold,color=green,weight=4] DOT deliver2 -> DONE [style=bold,color=green,weight=4]
* *
...@@ -289,13 +292,13 @@ cnt_done(struct sess *sp) ...@@ -289,13 +292,13 @@ cnt_done(struct sess *sp)
* Emit an error * Emit an error
* *
DOT subgraph xcluster_error { DOT subgraph xcluster_error {
DOT error [ DOT vcl_error [
DOT shape=ellipse DOT shape=record
DOT label="Issue HTTP error" DOT label="vcl_error()|resp."
DOT ] DOT ]
DOT ERROR -> error DOT ERROR -> vcl_error
DOT vcl_error-> deliver [label=deliver]
DOT } DOT }
DOT error -> DONE
*/ */
static int static int
...@@ -359,11 +362,14 @@ DOT fetch_pass [ ...@@ -359,11 +362,14 @@ DOT fetch_pass [
DOT shape=ellipse DOT shape=ellipse
DOT label="obj.pass=true" DOT label="obj.pass=true"
DOT ] DOT ]
DOT vcl_fetch -> fetch_pass [label="pass"] DOT vcl_fetch -> fetch_pass [label="pass",style=bold,color=red]
DOT } DOT }
DOT fetch_pass -> deliver DOT fetch_pass -> deliver [style=bold,color=red]
DOT vcl_fetch -> deliver [label="insert",style=bold,color=blue,weight=2] DOT vcl_fetch -> deliver [label="deliver",style=bold,color=blue,weight=2]
DOT vcl_fetch -> recv [label="restart"] 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 vcl_fetch -> errfetch [label="error"]
DOT errfetch [label="ERROR",shape=plaintext] DOT errfetch [label="ERROR",shape=plaintext]
*/ */
...@@ -422,7 +428,7 @@ VSL(SLT_Debug, sp->fd, "Fetch = %d", i); ...@@ -422,7 +428,7 @@ VSL(SLT_Debug, sp->fd, "Fetch = %d", i);
case VCL_RET_PASS: case VCL_RET_PASS:
sp->obj->pass = 1; sp->obj->pass = 1;
break; break;
case VCL_RET_INSERT: case VCL_RET_DELIVER:
break; break;
default: default:
INCOMPL(); INCOMPL();
...@@ -499,7 +505,9 @@ DOT ] ...@@ -499,7 +505,9 @@ DOT ]
DOT } DOT }
DOT hit -> err_hit [label="error"] DOT hit -> err_hit [label="error"]
DOT err_hit [label="ERROR",shape=plaintext] 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] 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] ...@@ -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 lookup -> lookup2 [label="yes",style=bold,color=green,weight=4]
DOT } DOT }
DOT lookup2 -> hit [label="no", style=bold,color=green,weight=4] 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] DOT lookup -> miss [label="no",style=bold,color=blue,weight=2]
*/ */
...@@ -658,10 +666,12 @@ DOT label="vcl_miss()|req.\nbereq." ...@@ -658,10 +666,12 @@ DOT label="vcl_miss()|req.\nbereq."
DOT ] DOT ]
DOT miss -> vcl_miss [style=bold,color=blue,weight=2] DOT miss -> vcl_miss [style=bold,color=blue,weight=2]
DOT } 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 vcl_miss -> err_miss [label="error"]
DOT err_miss [label="ERROR",shape=plaintext] DOT err_miss [label="ERROR",shape=plaintext]
DOT vcl_miss -> fetch [label="fetch",style=bold,color=blue,weight=2] 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 DOT
*/ */
...@@ -725,11 +735,13 @@ DOT pass_do [ ...@@ -725,11 +735,13 @@ DOT pass_do [
DOT shape=ellipse DOT shape=ellipse
DOT label="create anon object\n" DOT label="create anon object\n"
DOT ] DOT ]
DOT pass -> pass2 DOT pass -> pass2 [style=bold, color=red]
DOT pass2 -> vcl_pass DOT pass2 -> vcl_pass [style=bold, color=red]
DOT vcl_pass -> pass_do [label="pass"] DOT vcl_pass -> pass_do [label="pass"] [style=bold, color=red]
DOT } 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 vcl_pass -> err_pass [label="error"]
DOT err_pass [label="ERROR",shape=plaintext] DOT err_pass [label="ERROR",shape=plaintext]
*/ */
...@@ -776,10 +788,10 @@ DOT pipe_do [ ...@@ -776,10 +788,10 @@ DOT pipe_do [
DOT shape=ellipse DOT shape=ellipse
DOT label="send bereq.\npipe until close" DOT label="send bereq.\npipe until close"
DOT ] DOT ]
DOT vcl_pipe -> pipe_do [label="pipe"] DOT vcl_pipe -> pipe_do [label="pipe",style=bold,color=orange]
DOT pipe -> vcl_pipe DOT pipe -> vcl_pipe [style=bold,color=orange]
DOT } DOT }
DOT pipe_do -> DONE DOT pipe_do -> DONE [style=bold,color=orange]
DOT vcl_pipe -> err_pipe [label="error"] DOT vcl_pipe -> err_pipe [label="error"]
DOT err_pipe [label="ERROR",shape=plaintext] DOT err_pipe [label="ERROR",shape=plaintext]
*/ */
...@@ -816,8 +828,9 @@ DOT shape=record ...@@ -816,8 +828,9 @@ DOT shape=record
DOT label="vcl_recv()|req." DOT label="vcl_recv()|req."
DOT ] DOT ]
DOT } DOT }
DOT recv -> pipe [label="pipe"] DOT RESTART -> recv
DOT recv -> pass2 [label="pass"] 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 recv -> err_recv [label="error"]
DOT err_recv [label="ERROR",shape=plaintext] DOT err_recv [label="ERROR",shape=plaintext]
DOT recv -> hash [label="lookup",style=bold,color=green,weight=4] DOT recv -> hash [label="lookup",style=bold,color=green,weight=4]
......
...@@ -142,7 +142,7 @@ static const char *default_vcl = ...@@ -142,7 +142,7 @@ static const char *default_vcl =
" pass;\n" " pass;\n"
" }\n" " }\n"
" set obj.prefetch = -30s;" " set obj.prefetch = -30s;"
" insert;\n" " deliver;\n"
"}\n" "}\n"
"sub vcl_deliver {\n" "sub vcl_deliver {\n"
" deliver;\n" " deliver;\n"
......
...@@ -15,11 +15,10 @@ VCL_RET_MAC(hash, HASH, (1 << 2), 2) ...@@ -15,11 +15,10 @@ VCL_RET_MAC(hash, HASH, (1 << 2), 2)
VCL_RET_MAC(pipe, PIPE, (1 << 3), 3) VCL_RET_MAC(pipe, PIPE, (1 << 3), 3)
VCL_RET_MAC(pass, PASS, (1 << 4), 4) VCL_RET_MAC(pass, PASS, (1 << 4), 4)
VCL_RET_MAC(fetch, FETCH, (1 << 5), 5) VCL_RET_MAC(fetch, FETCH, (1 << 5), 5)
VCL_RET_MAC(insert, INSERT, (1 << 6), 6) VCL_RET_MAC(deliver, DELIVER, (1 << 6), 6)
VCL_RET_MAC(deliver, DELIVER, (1 << 7), 7) VCL_RET_MAC(discard, DISCARD, (1 << 7), 7)
VCL_RET_MAC(discard, DISCARD, (1 << 8), 8) VCL_RET_MAC(keep, KEEP, (1 << 8), 8)
VCL_RET_MAC(keep, KEEP, (1 << 9), 9) VCL_RET_MAC(restart, RESTART, (1 << 9), 9)
VCL_RET_MAC(restart, RESTART, (1 << 10), 10)
#else #else
#define VCL_RET_ERROR (1 << 0) #define VCL_RET_ERROR (1 << 0)
#define VCL_RET_LOOKUP (1 << 1) #define VCL_RET_LOOKUP (1 << 1)
...@@ -27,22 +26,21 @@ VCL_RET_MAC(restart, RESTART, (1 << 10), 10) ...@@ -27,22 +26,21 @@ VCL_RET_MAC(restart, RESTART, (1 << 10), 10)
#define VCL_RET_PIPE (1 << 3) #define VCL_RET_PIPE (1 << 3)
#define VCL_RET_PASS (1 << 4) #define VCL_RET_PASS (1 << 4)
#define VCL_RET_FETCH (1 << 5) #define VCL_RET_FETCH (1 << 5)
#define VCL_RET_INSERT (1 << 6) #define VCL_RET_DELIVER (1 << 6)
#define VCL_RET_DELIVER (1 << 7) #define VCL_RET_DISCARD (1 << 7)
#define VCL_RET_DISCARD (1 << 8) #define VCL_RET_KEEP (1 << 8)
#define VCL_RET_KEEP (1 << 9) #define VCL_RET_RESTART (1 << 9)
#define VCL_RET_RESTART (1 << 10) #define VCL_RET_MAX 10
#define VCL_RET_MAX 11
#endif #endif
#ifdef VCL_MET_MAC #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(recv,RECV,(VCL_RET_ERROR|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(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(pass,PASS,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS))
VCL_MET_MAC(hash,HASH,(VCL_RET_HASH)) 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(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(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(deliver,DELIVER,(VCL_RET_RESTART|VCL_RET_DELIVER))
VCL_MET_MAC(prefetch,PREFETCH,(VCL_RET_FETCH|VCL_RET_PASS)) VCL_MET_MAC(prefetch,PREFETCH,(VCL_RET_FETCH|VCL_RET_PASS))
VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD)) VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD))
......
...@@ -225,11 +225,10 @@ vcl_output_lang_h(struct vsb *sb) ...@@ -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_PIPE (1 << 3)\n");
vsb_cat(sb, "#define VCL_RET_PASS (1 << 4)\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_FETCH (1 << 5)\n");
vsb_cat(sb, "#define VCL_RET_INSERT (1 << 6)\n"); vsb_cat(sb, "#define VCL_RET_DELIVER (1 << 6)\n");
vsb_cat(sb, "#define VCL_RET_DELIVER (1 << 7)\n"); vsb_cat(sb, "#define VCL_RET_DISCARD (1 << 7)\n");
vsb_cat(sb, "#define VCL_RET_DISCARD (1 << 8)\n"); vsb_cat(sb, "#define VCL_RET_KEEP (1 << 8)\n");
vsb_cat(sb, "#define VCL_RET_KEEP (1 << 9)\n"); vsb_cat(sb, "#define VCL_RET_RESTART (1 << 9)\n");
vsb_cat(sb, "#define VCL_RET_RESTART (1 << 10)\n");
vsb_cat(sb, "/*\n"); vsb_cat(sb, "/*\n");
vsb_cat(sb, " * $Id$\n"); vsb_cat(sb, " * $Id$\n");
vsb_cat(sb, " *\n"); vsb_cat(sb, " *\n");
...@@ -487,8 +486,6 @@ vcl_output_lang_h(struct vsb *sb) ...@@ -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, "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, "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, "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, "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, "void VRT_l_obj_cacheable(const struct sess *, unsigned);\n");
vsb_cat(sb, "double VRT_r_obj_ttl(const struct sess *);\n"); vsb_cat(sb, "double VRT_r_obj_ttl(const struct sess *);\n");
......
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
# Second element is list of valid return actions. # Second element is list of valid return actions.
# #
set methods { set methods {
{recv {error restart pass pipe lookup}} {recv {error pass pipe lookup}}
{pipe {error restart pipe}} {pipe {error pipe}}
{pass {error restart pass}} {pass {error restart pass}}
{hash {hash}} {hash {hash}}
{miss {error restart pass fetch}} {miss {error restart pass fetch}}
{hit {error restart pass deliver}} {hit {error restart pass deliver}}
{fetch {error restart pass insert}} {fetch {error restart pass deliver}}
{deliver {restart deliver}} {deliver {restart deliver}}
{prefetch {fetch pass}} {prefetch {fetch pass}}
{timeout {fetch discard}} {timeout {fetch discard}}
...@@ -57,7 +57,6 @@ set returns { ...@@ -57,7 +57,6 @@ set returns {
pipe pipe
pass pass
fetch fetch
insert
deliver deliver
discard discard
keep keep
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment