Commit 6998d079 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Use shutdown for both directions, TCP works correctly.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2841 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent dcfb69ba
...@@ -37,7 +37,3 @@ client c1 { ...@@ -37,7 +37,3 @@ client c1 {
} }
client c1 -run client c1 -run
server s1 -wait
varnish v1 -stop
...@@ -80,8 +80,6 @@ server_thread(void *priv) ...@@ -80,8 +80,6 @@ server_thread(void *priv)
struct sockaddr_storage addr_s; struct sockaddr_storage addr_s;
struct sockaddr *addr; struct sockaddr *addr;
socklen_t l; socklen_t l;
char c;
CAST_OBJ_NOTNULL(s, priv, SERVER_MAGIC); CAST_OBJ_NOTNULL(s, priv, SERVER_MAGIC);
assert(s->sock >= 0); assert(s->sock >= 0);
...@@ -99,10 +97,7 @@ server_thread(void *priv) ...@@ -99,10 +97,7 @@ server_thread(void *priv)
http_process(vl, s->spec, fd, 0); http_process(vl, s->spec, fd, 0);
vtc_log(vl, 3, "shutting fd %d", fd); vtc_log(vl, 3, "shutting fd %d", fd);
AZ(shutdown(fd, SHUT_WR)); AZ(shutdown(fd, SHUT_WR));
while (1 == read(fd, &c, 1)) AZ(shutdown(fd, SHUT_RD));
continue;
vtc_log(vl, 3, "closing fd %d", fd);
AZ(close(fd));
} }
vtc_log(vl, 2, "Ending"); vtc_log(vl, 2, "Ending");
return (NULL); return (NULL);
...@@ -176,7 +171,7 @@ server_wait(struct server *s) ...@@ -176,7 +171,7 @@ server_wait(struct server *s)
vtc_log(s->vl, 2, "Waiting for server"); vtc_log(s->vl, 2, "Waiting for server");
AZ(pthread_join(s->tp, &res)); AZ(pthread_join(s->tp, &res));
if (res != NULL) { if (res != NULL) {
vtc_log(s->vl, 0, "Server returned \"%s\"", vtc_log(s->vl, 0, "Server returned \"%p\"",
(char *)res); (char *)res);
exit (1); exit (1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment