[experimental-ims] 6734c86 Clear the poll structure beforehand in order to make sure there are no lingering bits.

Geoff Simmons geoff at varnish-cache.org
Mon Jan 9 21:51:58 CET 2012


commit 6734c8682f4a32c5240ccba10dbc61876a2de89c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 20 09:05:58 2011 +0000

    Clear the poll structure beforehand in order to make sure there
    are no lingering bits.
    
    Convert an assert to a failure.

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 9c0f175..d01240b 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -899,8 +899,9 @@ cmd_http_send(CMD_ARGS)
 	AZ(av[2]);
 	vtc_dump(hp->vl, 4, "send", av[1], -1);
 	i = write(hp->fd, av[1], strlen(av[1]));
-	assert(i == strlen(av[1]));
-
+	if (i != strlen(av[1]))
+		vtc_log(hp->vl, 0, "Write error in http_send(): %s",
+		    strerror(errno));
 }
 
 /**********************************************************************
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 2ebef93..5ef4beb 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -349,6 +349,7 @@ varnish_launch(struct varnish *v)
 	AZ(pthread_create(&v->tp_vsl, NULL, varnishlog_thread, v));
 
 	/* Wait for the varnish to call home */
+	memset(fd, 0, sizeof fd);
 	fd[0].fd = v->cli_fd;
 	fd[0].events = POLLIN;
 	fd[1].fd = v->fds[0];



More information about the varnish-commit mailing list