From: phk Date: Tue, 8 Jul 2008 09:17:42 +0000 (+0000) Subject: Also make the backend probe rate (how often we probe) configurable X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=972ab2d1dc0d5f25a558e9bd336679d2d9fe9792;p=varnish Also make the backend probe rate (how often we probe) configurable in VCL. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2903 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/vrt.h b/varnish-cache/include/vrt.h index 49cfeb14..8bf11690 100644 --- a/varnish-cache/include/vrt.h +++ b/varnish-cache/include/vrt.h @@ -48,6 +48,7 @@ struct sockaddr; struct vrt_backend_probe { char *request; double timeout; + double rate; }; /* diff --git a/varnish-cache/lib/libvcl/vcc_backend.c b/varnish-cache/lib/libvcl/vcc_backend.c index 484d2d83..4c30324a 100644 --- a/varnish-cache/lib/libvcl/vcc_backend.c +++ b/varnish-cache/lib/libvcl/vcc_backend.c @@ -242,7 +242,7 @@ vcc_ParseProbe(struct tokenlist *tl) struct token *t_field; struct token *t_did = NULL; - fs = vcc_FldSpec(tl, "?url", "?request", "?timeout", NULL); + fs = vcc_FldSpec(tl, "?url", "?request", "?timeout", "?rate", NULL); ExpectErr(tl, '{'); vcc_NextToken(tl); @@ -284,6 +284,13 @@ vcc_ParseProbe(struct tokenlist *tl) tl->fb = NULL; ERRCHK(tl); Fh(tl, 0, ",\n"); + } else if (vcc_IdIs(t_field, "rate")) { + Fh(tl, 0, "\t\t.rate = "); + tl->fb = tl->fh; + vcc_TimeVal(tl); + tl->fb = NULL; + ERRCHK(tl); + Fh(tl, 0, ",\n"); } else { vcc_ErrToken(tl, t_field); vcc_ErrWhere(tl, t_field); diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index da89ee4b..accc74f2 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -386,6 +386,7 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, "struct vrt_backend_probe {\n"); vsb_cat(sb, " char *request;\n"); vsb_cat(sb, " double timeout;\n"); + vsb_cat(sb, " double rate;\n"); vsb_cat(sb, "};\n"); vsb_cat(sb, "\n"); vsb_cat(sb, "/*\n");