r2841 - in trunk/varnish-cache/bin/varnishtest: . tests

phk at projects.linpro.no phk at projects.linpro.no
Fri Jun 27 00:27:37 CEST 2008


Author: phk
Date: 2008-06-27 00:27:37 +0200 (Fri, 27 Jun 2008)
New Revision: 2841

Modified:
   trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc
   trunk/varnish-cache/bin/varnishtest/vtc_server.c
Log:
Use shutdown for both directions, TCP works correctly.



Modified: trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc	2008-06-26 22:14:02 UTC (rev 2840)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc	2008-06-26 22:27:37 UTC (rev 2841)
@@ -37,7 +37,3 @@
 }
 
 client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop

Modified: trunk/varnish-cache/bin/varnishtest/vtc_server.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_server.c	2008-06-26 22:14:02 UTC (rev 2840)
+++ trunk/varnish-cache/bin/varnishtest/vtc_server.c	2008-06-26 22:27:37 UTC (rev 2841)
@@ -80,9 +80,7 @@
 	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 @@
 		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 @@
 	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);
 	}




More information about the varnish-commit mailing list