]> err.no Git - varnish/commitdiff
Make up my mind: defaults go in varnishd
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Aug 2008 08:25:48 +0000 (08:25 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Aug 2008 08:25:48 +0000 (08:25 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3099 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvcl/vcc_backend.c

index 0119a920f037b59bb149c9cdbc6a734885816840..64c8215805f8616aedd81c695b7c851ad108beeb 100644 (file)
@@ -351,8 +351,8 @@ vcc_ParseProbe(struct tokenlist *tl)
        ExpectErr(tl, '{');
        vcc_NextToken(tl);
 
-       window = 8;
-       threshold = 3;
+       window = 0;
+       threshold = 0;
        Fb(tl, 0, "\t.probe = {\n");
        while (tl->t->tok != '}') {
 
@@ -414,32 +414,36 @@ vcc_ParseProbe(struct tokenlist *tl)
                vcc_NextToken(tl);
        }
 
-       if (t_threshold == NULL && t_window != NULL) {
-               vsb_printf(tl->sb, "Must specify .threshold with .window\n");
-               vcc_ErrWhere(tl, t_window);
-               return;
-       } else if (t_threshold != NULL && t_window == NULL) {
-               if (threshold > 64) {
-                       vsb_printf(tl->sb, "Threshold must be 64 or less.\n");
-                       vcc_ErrWhere(tl, t_threshold);
+       if (t_threshold != NULL || t_window != NULL) {
+               if (t_threshold == NULL && t_window != NULL) {
+                       vsb_printf(tl->sb,
+                           "Must specify .threshold with .window\n");
+                       vcc_ErrWhere(tl, t_window);
+                       return;
+               } else if (t_threshold != NULL && t_window == NULL) {
+                       if (threshold > 64) {
+                               vsb_printf(tl->sb,
+                                   "Threshold must be 64 or less.\n");
+                               vcc_ErrWhere(tl, t_threshold);
+                               return;
+                       }
+                       window = threshold + 1;
+               } else if (window > 64) {
+                       AN(t_window);
+                       vsb_printf(tl->sb, "Window must be 64 or less.\n");
+                       vcc_ErrWhere(tl, t_window);
                        return;
                }
-               window = threshold + 1;
-       } else if (window > 64) {
-               AN(t_window);
-               vsb_printf(tl->sb, "Window must be 64 or less.\n");
-               vcc_ErrWhere(tl, t_window);
-               return;
-       }
-       if (threshold > window ) {
-               vsb_printf(tl->sb,
-                   "Threshold can not be greater than window.\n");
-               vcc_ErrWhere(tl, t_threshold);
-               AN(t_window);
-               vcc_ErrWhere(tl, t_window);
+               if (threshold > window ) {
+                       vsb_printf(tl->sb,
+                           "Threshold can not be greater than window.\n");
+                       vcc_ErrWhere(tl, t_threshold);
+                       AN(t_window);
+                       vcc_ErrWhere(tl, t_window);
+               }
+               Fb(tl, 0, "\t\t.window = %u,\n", window);
+               Fb(tl, 0, "\t\t.threshold = %u\n", threshold);
        }
-       Fb(tl, 0, "\t\t.window = %u,\n", window);
-       Fb(tl, 0, "\t\t.threshold = %u\n", threshold);
        Fb(tl, 0, "\t},\n");
        ExpectErr(tl, '}');
        vcc_NextToken(tl);