r2903 - in trunk/varnish-cache: include lib/libvcl
phk at projects.linpro.no
phk at projects.linpro.no
Tue Jul 8 11:17:43 CEST 2008
Author: phk
Date: 2008-07-08 11:17:42 +0200 (Tue, 08 Jul 2008)
New Revision: 2903
Modified:
trunk/varnish-cache/include/vrt.h
trunk/varnish-cache/lib/libvcl/vcc_backend.c
trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
Log:
Also make the backend probe rate (how often we probe) configurable
in VCL.
Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h 2008-07-08 09:15:32 UTC (rev 2902)
+++ trunk/varnish-cache/include/vrt.h 2008-07-08 09:17:42 UTC (rev 2903)
@@ -48,6 +48,7 @@
struct vrt_backend_probe {
char *request;
double timeout;
+ double rate;
};
/*
Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-07-08 09:15:32 UTC (rev 2902)
+++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-07-08 09:17:42 UTC (rev 2903)
@@ -242,7 +242,7 @@
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 @@
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);
Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-07-08 09:15:32 UTC (rev 2902)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-07-08 09:17:42 UTC (rev 2903)
@@ -386,6 +386,7 @@
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");
More information about the varnish-commit
mailing list