From 6f33dc08ec7f001f79874afd69b1c610ddb7a338 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 18 Aug 2008 08:25:48 +0000 Subject: [PATCH] Make up my mind: defaults go in varnishd git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3099 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/lib/libvcl/vcc_backend.c | 54 ++++++++++++++------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/varnish-cache/lib/libvcl/vcc_backend.c b/varnish-cache/lib/libvcl/vcc_backend.c index 0119a920..64c82158 100644 --- a/varnish-cache/lib/libvcl/vcc_backend.c +++ b/varnish-cache/lib/libvcl/vcc_backend.c @@ -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); -- 2.39.5