From: phk Date: Sun, 19 Aug 2007 21:20:48 +0000 (+0000) Subject: Reset the cli buffer when we have soaked up all it contained. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ba522b9f3fc92a1aaa10a4ff457e891c92829ba;p=varnish 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 --- 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: