]> err.no Git - varnish/commitdiff
Reset the cli buffer when we have soaked up all it contained.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 19 Aug 2007 21:20:48 +0000 (21:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 19 Aug 2007 21:20:48 +0000 (21:20 +0000)
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

index 07e690264b04a44b23a0c1d1b8e655ec969e1101..4de8f5d99b3412f2c3e3e9f31fbb40af522c79d5 100644 (file)
@@ -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: