Commit c2bc74be authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Also make the backend probe rate (how often we probe) configurable

in VCL.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2903 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent e1523131
......@@ -48,6 +48,7 @@ struct sockaddr;
struct vrt_backend_probe {
char *request;
double timeout;
double rate;
};
/*
......
......@@ -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);
......
......@@ -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");
......
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