]> err.no Git - varnish/commitdiff
Automatically wait for servers and clients during reset pass.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 17 Jun 2008 20:27:31 +0000 (20:27 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 17 Jun 2008 20:27:31 +0000 (20:27 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2730 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/t001.vtc
varnish-cache/bin/varnishtest/vtc_client.c
varnish-cache/bin/varnishtest/vtc_server.c

index a55d2d116c9fdf744e619a30bf348202c516fa56..a030c1bdca3c65a4d6544c36bf5648c974ad6016 100644 (file)
@@ -2,20 +2,6 @@
 #
 # $Id$
 
-varnish v1 -launch
-
-varnish v1 -vcl {
-       backend s1 {
-               .host = "localhost";
-               .port = "9080";
-       }
-       sub vcl_recv {
-               pipe;
-       }
-}
-
-varnish v1 -start
-
 server s1 -repeat 1 {
        rxreq 
        txresp \
@@ -25,6 +11,16 @@ server s1 -repeat 1 {
                -body "012345\n"
 }
 
+varnish v1 -launch
+
+varnish v1 -vcl+backend {
+       sub vcl_recv {
+               pipe;
+       }
+}
+
+varnish v1 -start
+
 server s1 -start 
 
 client c1 {
@@ -35,6 +31,6 @@ client c1 {
 
 client c1 -run
 
-server s1 -wait
+server s1 -wait
 
-varnish v1 -stop
+# varnish v1 -wait
index 725f485889d73feb1b51c251db15f004bc62307d..cb33dc7a2799bef9816fae256385143bcf68f920 100644 (file)
@@ -167,6 +167,8 @@ cmd_client(char **av, void *priv)
                /* Reset and free */
                VTAILQ_FOREACH_SAFE(c, &clients, list, c2) {
                        VTAILQ_REMOVE(&clients, c, list);
+                       if (c->tp != NULL)
+                               client_wait(c);
                        FREE_OBJ(c);
                        /* XXX: MEMLEAK */
                }
index 460538f670d0896c68444d193c2b2a92fa1ffadb..3d9afbfa1b712e6a27f66244ff5eacbcb6248566 100644 (file)
@@ -209,6 +209,8 @@ cmd_server(char **av, void *priv)
                /* Reset and free */
                VTAILQ_FOREACH_SAFE(s, &servers, list, s2) {
                        VTAILQ_REMOVE(&servers, s, list);
+                       if (s->sock >= 0) 
+                               server_wait(s);
                        FREE_OBJ(s);
                        /* XXX: MEMLEAK */
                }