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

EOF detection in libevent is buggy ?? Add exit cmd.

Pause after cli until we see "OK"



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@447 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 82d54990
......@@ -218,6 +218,8 @@ rd_pipe2(struct bufferevent *bev, void *arg)
printf("V: <<%s>>\n", p);
if (!strcmp(p, "Child said <Ready>"))
Resume();
else if (!strcmp(p, "OK"))
Resume();
}
}
......@@ -305,6 +307,7 @@ cmd_cli(char **av)
}
cli_write(av[0]);
cli_write("\n");
Pause();
}
/*--------------------------------------------------------------------*/
......@@ -461,6 +464,18 @@ cmd_req(char **av)
/*--------------------------------------------------------------------*/
static void
cmd_exit(char **av)
{
(void)av;
cmd_close(NULL);
cmd_stop(NULL);
exit (0);
}
/*--------------------------------------------------------------------*/
static struct bufferevent *e_cmd;
static int run = 1;
......@@ -500,6 +515,8 @@ rd_cmd(struct bufferevent *bev, void *arg)
cmd_close(av + 2);
else if (!strcmp(av[1], "req"))
cmd_req(av + 2);
else if (!strcmp(av[1], "exit"))
cmd_exit(av + 2);
else {
fprintf(stderr, "Unknown command \"%s\"\n", av[1]);
exit (2);
......
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