From: phk Date: Tue, 26 Aug 2008 07:51:12 +0000 (+0000) Subject: Use TCP_close() to properly ignore the "canonical" TCP legal errno values X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e6a86a791fad15a49396c23d0916c02bbd39a0b;p=varnish Use TCP_close() to properly ignore the "canonical" TCP legal errno values consistently. Fixes #297 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3127 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/vtc_client.c b/varnish-cache/bin/varnishtest/vtc_client.c index 632274a3..cf9c3e43 100644 --- a/varnish-cache/bin/varnishtest/vtc_client.c +++ b/varnish-cache/bin/varnishtest/vtc_client.c @@ -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); diff --git a/varnish-cache/bin/varnishtest/vtc_server.c b/varnish-cache/bin/varnishtest/vtc_server.c index 71097d63..eaa74bcc 100644 --- a/varnish-cache/bin/varnishtest/vtc_server.c +++ b/varnish-cache/bin/varnishtest/vtc_server.c @@ -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; }