]> err.no Git - varnish/commitdiff
Use TCP_close() to properly ignore the "canonical" TCP legal errno values
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Aug 2008 07:51:12 +0000 (07:51 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 26 Aug 2008 07:51:12 +0000 (07:51 +0000)
consistently.

Fixes #297

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3127 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

index 632274a3626861d213eb2febe993d87e93bb6b04..cf9c3e430a17673bd237a98bb2013be4a7a68078 100644 (file)
@@ -87,7 +87,7 @@ client_thread(void *priv)
        vtc_log(vl, 3, "Connected to %s fd is %d", c->connect, fd);
        http_process(vl, c->spec, fd, 1);
        vtc_log(vl, 3, "Closing fd %d", fd);
-       AZ(close(fd));
+       TCP_close(&fd);
        vtc_log(vl, 2, "Ending");
 
        return (NULL);
index 71097d63a458d5e88a007e6df4260f313cc1c4a7..eaa74bcc31f4e24467d7fbdd70c4ad99ebbf89a1 100644 (file)
@@ -98,7 +98,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));
-               assert(close(fd) == 0 || errno == ECONNRESET);
+               TCP_close(&fd);
        }
        vtc_log(vl, 2, "Ending");
        return (NULL);
@@ -177,7 +177,7 @@ server_wait(struct server *s)
                exit (1);
        }
        s->tp = 0;
-       AZ(close(s->sock));
+       TCP_close(&s->sock);
        s->sock = -1;
 }