[6.0] d8f5f2fe9 Allow a > 0 in VTCP_Check()

Reza Naghibi reza at naghibi.com
Thu Apr 22 15:55:06 UTC 2021


commit d8f5f2fe92665134cc9a00c784902f9b70b62b7c
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 13b1ab9ed..a40d3d1e4 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -560,6 +560,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