From 04f994c2b0476ec1387269dacf510e4a6999788c Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 30 Sep 2007 20:38:15 +0000 Subject: [PATCH] Add req.restarts variable. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2066 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/include/vrt_obj.h | 1 + varnish-cache/lib/libvcl/vcc_fixed_token.c | 1 + varnish-cache/lib/libvcl/vcc_gen_obj.tcl | 5 +++++ varnish-cache/lib/libvcl/vcc_obj.c | 7 +++++++ 4 files changed, 14 insertions(+) diff --git a/varnish-cache/include/vrt_obj.h b/varnish-cache/include/vrt_obj.h index ec7065d8..f8a9cd4a 100644 --- a/varnish-cache/include/vrt_obj.h +++ b/varnish-cache/include/vrt_obj.h @@ -21,6 +21,7 @@ void VRT_l_req_proto(const struct sess *, const char *, ...); void VRT_l_req_hash(struct sess *, const char *); struct backend * VRT_r_req_backend(struct sess *); void VRT_l_req_backend(struct sess *, struct backend *); +int VRT_r_req_restarts(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 *); diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index 3885cabc..0c92723a 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -530,6 +530,7 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, "void VRT_l_req_hash(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, "int VRT_r_req_restarts(const struct sess *);\n"); vsb_cat(sb, "const char * VRT_r_bereq_request(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_bereq_request(const struct sess *, const char *, ...);\n"); vsb_cat(sb, "const char * VRT_r_bereq_url(const struct sess *);\n"); diff --git a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl index 624c3454..c50a11ff 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl @@ -92,6 +92,11 @@ set spobj { {recv pipe pass hash miss hit fetch } "struct sess *" } + { req.restarts + RO INT + {recv pipe pass hash miss hit fetch deliver } + "const struct sess *" + } # Request sent to backend { bereq.request diff --git a/varnish-cache/lib/libvcl/vcc_obj.c b/varnish-cache/lib/libvcl/vcc_obj.c index 21bb8168..7c01cb50 100644 --- a/varnish-cache/lib/libvcl/vcc_obj.c +++ b/varnish-cache/lib/libvcl/vcc_obj.c @@ -98,6 +98,13 @@ struct var vcc_vars[] = { 0, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH }, + { "req.restarts", INT, 12, + "VRT_r_req_restarts(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 + }, { "bereq.request", STRING, 13, "VRT_r_bereq_request(sp)", "VRT_l_bereq_request(sp, ", -- 2.39.5