Commit 84baeda9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add vcl_deliver() method where touch-up's to the returned reply can

be performed.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1612 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 5e4e4adf
......@@ -127,6 +127,9 @@ static const char *default_vcl =
" }\n"
" insert;\n"
"}\n"
"sub vcl_deliver {\n"
" deliver;\n"
"}\n"
"sub vcl_discard {\n"
" discard;\n"
"}\n"
......
......@@ -38,6 +38,7 @@ struct VCL_conf {
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;
};
......@@ -41,6 +41,7 @@ VCL_MET_MAC(hash,HASH,(VCL_RET_HASH))
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 @@ VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_KEEP))
#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
......@@ -350,6 +350,7 @@ vcl_output_lang_h(struct vsb *sb)
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 @@ vcl_output_lang_h(struct vsb *sb)
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 @@ vcl_output_lang_h(struct vsb *sb)
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");
}
......@@ -41,6 +41,7 @@ set methods {
{miss {error pass fetch}}
{hit {error pass deliver}}
{fetch {error pass insert}}
{deliver {error deliver}}
{timeout {fetch discard}}
{discard {discard 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