]> err.no Git - varnish/commitdiff
Use shutdown for both directions, TCP works correctly.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 22:27:37 +0000 (22:27 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 22:27:37 +0000 (22:27 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2841 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/tests/b00007.vtc
varnish-cache/bin/varnishtest/vtc_server.c

index c0c00addbe7f3ec928041979095b38cc6759524d..559b558df4b7c7181f40c507ac96f5ae30c6c529 100644 (file)
@@ -37,7 +37,3 @@ client c1 {
 }
 
 client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop
index bb62570b338f749c6887a63295d3f9b53113d5d3..ee48866099896aa817b19306ac3924e30599a88e 100644 (file)
@@ -80,8 +80,6 @@ server_thread(void *priv)
        struct sockaddr_storage addr_s;
        struct sockaddr *addr;
        socklen_t l;
-       char c;
-
 
        CAST_OBJ_NOTNULL(s, priv, SERVER_MAGIC);
        assert(s->sock >= 0);
@@ -99,10 +97,7 @@ server_thread(void *priv)
                http_process(vl, s->spec, fd, 0);
                vtc_log(vl, 3, "shutting fd %d", fd);
                AZ(shutdown(fd, SHUT_WR));
-               while (1 == read(fd, &c, 1))
-                       continue;
-               vtc_log(vl, 3, "closing fd %d", fd);
-               AZ(close(fd));
+               AZ(shutdown(fd, SHUT_RD));
        }
        vtc_log(vl, 2, "Ending");
        return (NULL);
@@ -176,7 +171,7 @@ server_wait(struct server *s)
        vtc_log(s->vl, 2, "Waiting for server");
        AZ(pthread_join(s->tp, &res));
        if (res != NULL) {
-               vtc_log(s->vl, 0, "Server returned \"%s\"",
+               vtc_log(s->vl, 0, "Server returned \"%p\"",
                    (char *)res);
                exit (1);
        }