Commit 69a3615e authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

r33742@cat (orig r1221): des | 2006-11-08 09:59:20 +0100

 Rewrite tackle_warg(): don't override the default max or timeout unless
 the user asks; bail if max < min; fix usage string.


git-svn-id: http://www.varnish-cache.org/svn/branches/1.0@1245 d4fa192b-c00b-0410-8231-f00ffab90ce4
parents 71fc1463 1457a239
...@@ -194,7 +194,7 @@ usage(void) ...@@ -194,7 +194,7 @@ usage(void)
fprintf(stderr, " %-28s # %s\n", "", fprintf(stderr, " %-28s # %s\n", "",
" -w min,max"); " -w min,max");
fprintf(stderr, " %-28s # %s\n", "", fprintf(stderr, " %-28s # %s\n", "",
" -w min,max,timeout [default: -w1,INF,10]"); " -w min,max,timeout [default: -w1,1000,120]");
#if 0 #if 0
-c clusterid@cluster_controller -c clusterid@cluster_controller
-m memory_limit -m memory_limit
...@@ -211,21 +211,23 @@ usage(void) ...@@ -211,21 +211,23 @@ usage(void)
static void static void
tackle_warg(const char *argv) tackle_warg(const char *argv)
{ {
int i; unsigned int ua, ub, uc;
unsigned ua, ub, uc;
i = sscanf(argv, "%u,%u,%u", &ua, &ub, &uc); switch (sscanf(argv, "%u,%u,%u", &ua, &ub, &uc)) {
if (i == 0) case 3:
params->wthread_timeout = uc;
case 2:
if (ub < ua)
usage(); usage();
params->wthread_max = ub;
case 1:
if (ua < 1) if (ua < 1)
usage(); usage();
params->wthread_min = ua; params->wthread_min = ua;
params->wthread_max = ua; break;
params->wthread_timeout = 10; default:
if (i >= 2) usage();
params->wthread_max = ub; }
if (i >= 3)
params->wthread_timeout = uc;
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
......
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