From 4ba522b9f3fc92a1aaa10a4ff457e891c92829ba Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 19 Aug 2007 21:20:48 +0000 Subject: [PATCH] Reset the cli buffer when we have soaked up all it contained. Otherwise we will for ever be repeating the same command over and over, no matter what the input to the cli might be. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1859 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_cli.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/mgt_cli.c b/varnish-cache/bin/varnishd/mgt_cli.c index 07e69026..4de8f5d9 100644 --- a/varnish-cache/bin/varnishd/mgt_cli.c +++ b/varnish-cache/bin/varnishd/mgt_cli.c @@ -337,7 +337,8 @@ mgt_cli_callback(struct ev *e, int what) assert(q == cp->buf + cp->nbuf); cp->nbuf -= (p - cp->buf); memmove(cp->buf, p, cp->nbuf); - } + } else + cp->nbuf = 0; return (0); cli_close: -- 2.39.5