r219 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Jun 21 12:13:53 CEST 2006


Author: phk
Date: 2006-06-21 12:13:53 +0200 (Wed, 21 Jun 2006)
New Revision: 219

Modified:
   trunk/varnish-cache/bin/varnishd/heritage.h
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Add "-t default_ttl" option.  120 seconds by default.


Modified: trunk/varnish-cache/bin/varnishd/heritage.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/heritage.h	2006-06-21 09:58:06 UTC (rev 218)
+++ trunk/varnish-cache/bin/varnishd/heritage.h	2006-06-21 10:13:53 UTC (rev 219)
@@ -30,6 +30,8 @@
 
 	/* Storage method */
 	struct stevedore	*stevedore;
+
+	unsigned		default_ttl;
 };
 
 extern struct heritage heritage;

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2006-06-21 09:58:06 UTC (rev 218)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2006-06-21 10:13:53 UTC (rev 219)
@@ -290,6 +290,7 @@
 	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 at cluster_controller
 	-m memory_limit
@@ -394,7 +395,9 @@
  
 	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 @@
 		case 's':
 			sflag = optarg;
 			break;
+		case 't':
+			heritage.default_ttl = strtoul(optarg, NULL, 0);
+			break;
 		default:
 			usage();
 		}




More information about the varnish-commit mailing list