r2009 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Sep 24 14:27:55 CEST 2007


Author: phk
Date: 2007-09-24 14:27:54 +0200 (Mon, 24 Sep 2007)
New Revision: 2009

Modified:
   trunk/varnish-cache/bin/varnishd/heritage.h
   trunk/varnish-cache/bin/varnishd/mgt_cli.c
   trunk/varnish-cache/bin/varnishd/mgt_param.c
Log:
Make the cli_timeout a parameter.  The master will wait this long
for the client to reply on the internal CLI pipe.



Modified: trunk/varnish-cache/bin/varnishd/heritage.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/heritage.h	2007-09-24 12:06:20 UTC (rev 2008)
+++ trunk/varnish-cache/bin/varnishd/heritage.h	2007-09-24 12:27:54 UTC (rev 2009)
@@ -117,7 +117,8 @@
 	unsigned		backend_http11;
 	unsigned		client_http11;
 
-	/* Ping interval */
+	/* CLI related */
+	unsigned		cli_timeout;
 	unsigned		ping_interval;
 
 	/* LRU list ordering interval */

Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.c	2007-09-24 12:06:20 UTC (rev 2008)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.c	2007-09-24 12:27:54 UTC (rev 2009)
@@ -49,6 +49,7 @@
 #include "cli.h"
 #include "vsb.h"
 #include "cli_common.h"
+#include "heritage.h"
 #include "mgt.h"
 #include "mgt_cli.h"
 #include "mgt_event.h"
@@ -126,7 +127,7 @@
 	xxxassert(i == vsb_len(sb));
 	vsb_delete(sb);
 
-	i = cli_readres(cli_i, &u, &p, 3.0);
+	i = cli_readres(cli_i, &u, &p, params->cli_timeout);
 	cli_result(cli, u);
 	cli_out(cli, "%s", p);
 	free(p);
@@ -247,7 +248,7 @@
 		return (CLIS_COMMS);
 	}
 
-	i = cli_readres(cli_i, &u, resp, 5.0);
+	i = cli_readres(cli_i, &u, resp, params->cli_timeout);
 	if (status != NULL)
 		*status = u;
 	return (u == CLIS_OK ? 0 : u);

Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c	2007-09-24 12:06:20 UTC (rev 2008)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c	2007-09-24 12:27:54 UTC (rev 2009)
@@ -516,6 +516,15 @@
 /*--------------------------------------------------------------------*/
 
 static void
+tweak_cli_timeout(struct cli *cli, struct parspec *par, const char *arg)
+{
+	(void)par;
+	tweak_generic_timeout(cli, &master.cli_timeout, arg);
+}
+
+/*--------------------------------------------------------------------*/
+
+static void
 tweak_ping_interval(struct cli *cli, struct parspec *par, const char *arg)
 {
 	(void)par;
@@ -719,6 +728,10 @@
 		"backend response."
 		EXPERIMENTAL,
 		"off", "bool" },
+	{ "cli_timeout", tweak_cli_timeout,
+		"Timeout for the childs replies to CLI requests from "
+		"the master.\n",
+		"5", "seconds" },
 	{ "ping_interval", tweak_ping_interval,
 		"Interval between pings from parent to child.\n"
 		"Zero will disable pinging entirely, which makes "




More information about the varnish-commit mailing list