Commit d260c72f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Attempt even harder to get diag on cli issues



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3933 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 0ac1ecc7
...@@ -97,7 +97,7 @@ varnish_ask_cli(const struct varnish *v, const char *cmd, char **repl) ...@@ -97,7 +97,7 @@ varnish_ask_cli(const struct varnish *v, const char *cmd, char **repl)
assert(i == strlen(cmd)); assert(i == strlen(cmd));
i = write(v->cli_fd, "\n", 1); i = write(v->cli_fd, "\n", 1);
assert(i == 1); assert(i == 1);
i = cli_readres(v->cli_fd, &retval, &r, 10.0); i = cli_readres(v->cli_fd, &retval, &r, 20.0);
if (i != 0) { if (i != 0) {
vtc_log(v->vl, 0, "CLI failed (%s) = %d %u %s", vtc_log(v->vl, 0, "CLI failed (%s) = %d %u %s",
cmd, i, retval, r); cmd, i, retval, r);
...@@ -295,8 +295,12 @@ varnish_start(struct varnish *v) ...@@ -295,8 +295,12 @@ varnish_start(struct varnish *v)
return; return;
vtc_log(v->vl, 2, "Start"); vtc_log(v->vl, 2, "Start");
u = varnish_ask_cli(v, "start", NULL); u = varnish_ask_cli(v, "start", NULL);
if (vtc_error)
return;
assert(u == CLIS_OK); assert(u == CLIS_OK);
u = varnish_ask_cli(v, "debug.xid 1000", NULL); u = varnish_ask_cli(v, "debug.xid 1000", NULL);
if (vtc_error)
return;
assert(u == CLIS_OK); assert(u == CLIS_OK);
} }
......
...@@ -164,7 +164,9 @@ cli_readres(int fd, unsigned *status, char **ptr, double tmo) ...@@ -164,7 +164,9 @@ cli_readres(int fd, unsigned *status, char **ptr, double tmo)
*status = CLIS_COMMS; *status = CLIS_COMMS;
if (ptr != NULL) if (ptr != NULL)
*ptr = strdup("CLI communication error (hdr)"); *ptr = strdup("CLI communication error (hdr)");
return (1); if (i != 0)
return (i);
return (400);
} }
assert(i == CLI_LINE0_LEN); assert(i == CLI_LINE0_LEN);
assert(res[3] == ' '); assert(res[3] == ' ');
......
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