]> err.no Git - varnish/commitdiff
Make the cli_timeout a parameter. The master will wait this long
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 24 Sep 2007 12:27:54 +0000 (12:27 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 24 Sep 2007 12:27:54 +0000 (12:27 +0000)
for the client to reply on the internal CLI pipe.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2009 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/heritage.h
varnish-cache/bin/varnishd/mgt_cli.c
varnish-cache/bin/varnishd/mgt_param.c

index b0e9f8a8122538db67f88ad5272683020904c1e3..27902b6b5d97822795cb65efd3b319764b0dedea 100644 (file)
@@ -117,7 +117,8 @@ struct params {
        unsigned                backend_http11;
        unsigned                client_http11;
 
-       /* Ping interval */
+       /* CLI related */
+       unsigned                cli_timeout;
        unsigned                ping_interval;
 
        /* LRU list ordering interval */
index 4de8f5d99b3412f2c3e3e9f31fbb40af522c79d5..8eb48064b50b03f598304249d38b64693c0033f8 100644 (file)
@@ -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 @@ mcf_passthru(struct cli *cli, char **av, void *priv)
        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 @@ mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...)
                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);
index b50556f670ea9fd97c1eeb05d7a90df2ce57a132..c0cfeb7ce5e65bbe7f2b70ac9a1632d65508d0bd 100644 (file)
@@ -515,6 +515,15 @@ tweak_client_http11(struct cli *cli, struct parspec *par, const char *arg)
 
 /*--------------------------------------------------------------------*/
 
+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)
 {
@@ -719,6 +728,10 @@ static struct parspec parspec[] = {
                "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 "