]> err.no Git - varnish/commitdiff
Also make the backend probe rate (how often we probe) configurable
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 8 Jul 2008 09:17:42 +0000 (09:17 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 8 Jul 2008 09:17:42 +0000 (09:17 +0000)
in VCL.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2903 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/vrt.h
varnish-cache/lib/libvcl/vcc_backend.c
varnish-cache/lib/libvcl/vcc_fixed_token.c

index 49cfeb14f3d122bad0485121e365d7ee94cfd6f8..8bf11690002ca2bb7e89a41ab2bcfd4ee510c277 100644 (file)
@@ -48,6 +48,7 @@ struct sockaddr;
 struct vrt_backend_probe {
        char            *request;
        double          timeout;
+       double          rate;
 };
 
 /*
index 484d2d83de5201a117c97e83d38cc3cd91b9931a..4c30324aa45c288309fa6d186fa2d43b77be7e43 100644 (file)
@@ -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);
index da89ee4b287c63d28071149570c479e54e094cbc..accc74f23bc0a9e99b4627c772b4f13822dd0393 100644 (file)
@@ -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");