From 2c807ba0913344278fa68e9ebd1fa3cb6e3f01e9 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 21 Jun 2006 10:13:53 +0000 Subject: [PATCH] Add "-t default_ttl" option. 120 seconds by default. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@219 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/heritage.h | 2 ++ varnish-cache/bin/varnishd/varnishd.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/heritage.h b/varnish-cache/bin/varnishd/heritage.h index 8aad4824..5f2da66c 100644 --- a/varnish-cache/bin/varnishd/heritage.h +++ b/varnish-cache/bin/varnishd/heritage.h @@ -30,6 +30,8 @@ struct heritage { /* Storage method */ struct stevedore *stevedore; + + unsigned default_ttl; }; extern struct heritage heritage; diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index 127a33dd..b2d67c62 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -290,6 +290,7 @@ usage(void) fprintf(stderr, " %-28s # %s\n", "-p number", "TCP listen port"); fprintf(stderr, " %-28s # %s\n", "-s kind[,storageoptions]", "Backend storage specification"); + fprintf(stderr, " %-28s # %s\n", "-t", "Default TTL"); #if 0 -c clusterid@cluster_controller -m memory_limit @@ -394,7 +395,9 @@ main(int argc, char *argv[]) VCC_InitCompile(); - while ((o = getopt(argc, argv, "b:df:p:s:")) != -1) + heritage.default_ttl = 120; + + while ((o = getopt(argc, argv, "b:df:p:s:t:")) != -1) switch (o) { case 'b': bflag = optarg; @@ -411,6 +414,9 @@ main(int argc, char *argv[]) case 's': sflag = optarg; break; + case 't': + heritage.default_ttl = strtoul(optarg, NULL, 0); + break; default: usage(); } -- 2.39.5