[master] 50d4b6f1e Apply workaround for macos

Federico G. Schwindt fgsch at lodoss.net
Sat Jun 23 10:29:12 UTC 2018

commit 50d4b6f1e72b00db0211ddc9c739fb438056673f
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Sat Jun 23 11:24:23 2018 +0100

    Apply workaround for macos
    A bound socket will timeout instead of refusing the connection.
    Should fix b00015.vtc under macos.

diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index e64bcfa41..e85ae92b7 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -492,6 +492,15 @@ ip_magic(void)
 	VTCP_myname(fd, abuf, sizeof abuf, pbuf, sizeof(pbuf));
 	extmacro_def("localhost", "%s", abuf);
+#if defined (__APPLE__)
+	/*
+	 * In MacOS a bound socket that is not listening will timeout
+	 * instead of refusing the connection so close it and hope
+	 * for the best.
+	 */
+	VTCP_close(&fd);
 	/* Expose a backend that is forever down. */
 	extmacro_def("bad_backend", "%s %s", abuf, pbuf);

More information about the varnish-commit mailing list