[master] 44d5cf339 Collapse the MacOS case with Solaris & NetBSD in VTCP_Check()

Nils Goroll nils.goroll at uplex.de
Mon Feb 22 19:01:07 UTC 2021


commit 44d5cf3395fd8d6f69dcdc88af0bc1458ee388bb
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Feb 22 19:53:27 2021 +0100

    Collapse the MacOS case with Solaris & NetBSD in VTCP_Check()

diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index d6e474249..9ac383769 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -610,18 +610,14 @@ VTCP_Check(ssize_t a)
 	if (errno == EPROTO)
 		return (1);
 #endif
-#if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__)
+#if (defined (__SVR4) && defined (__sun)) ||		\
+    defined (__NetBSD__) ||				\
+    defined (__APPLE__)
 	/*
-	 * Solaris returns EINVAL if the other end unexpectedly reset the
-	 * connection.
-	 * This is a bug in Solaris and documented behaviour on NetBSD.
-	 */
-	if (errno == EINVAL || errno == ETIMEDOUT)
-		return (1);
-#elif defined (__APPLE__)
-	/*
-	 * MacOS returns EINVAL if the other end unexpectedly reset
+	 * Solaris and MacOS returns EINVAL if the other end unexpectedly reset
 	 * the connection.
+	 *
+	 * On NetBSD it is documented behaviour.
 	 */
 	if (errno == EINVAL)
 		return (1);


More information about the varnish-commit mailing list