[master] 58a21da77 Allow a > 0 in VTCP_Check()

Martin Blix Grydeland martin at varnish-software.com
Mon Nov 9 15:13:08 UTC 2020


commit 58a21da7736295e674ebb7e8ae9eee9529c083b0
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Wed Oct 7 15:58:14 2020 +0200

    Allow a > 0 in VTCP_Check()
    
    When used to check the result of read() and write() calls, it is useful
    that a positive return value is accepted in VTCP_Check().

diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index 7baee4b06..851e3137e 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -562,6 +562,8 @@ VTCP_Check(ssize_t a)
 {
 	if (a == 0)
 		return (1);
+	if (a > 0)
+		return (1);
 	if (errno == ECONNRESET || errno == ENOTCONN || errno == EPIPE)
 		return (1);
 	/* Accept EAGAIN (and EWOULDBLOCK in case they are not the same)


More information about the varnish-commit mailing list