[6.0] 745924a09 Apply workaround for macos

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:15 UTC 2018


commit 745924a09e0488732ae997fb8f505cb8b2fef257
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);
+#endif
+
 	/* Expose a backend that is forever down. */
 	extmacro_def("bad_backend", "%s %s", abuf, pbuf);
 


More information about the varnish-commit mailing list