[6.0] c34255fa4 Only check errno if write(2) failed.

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:52:40 UTC 2018


commit c34255fa4de70b31fb35eca827880683b2bb78b0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Apr 11 07:18:36 2018 +0000

    Only check errno if write(2) failed.
    
    Hopefully this...
    
    Fixes   #2605

diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index edb9907fd..c88fffdb6 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -271,7 +271,8 @@ http1_minimal_response(struct req *req, uint16_t status)
 	if (wl > 0)
 		req->acct.resp_hdrbytes += wl;
 	if (wl != l) {
-		VTCP_Assert(1);
+		if (wl < 0)
+			VTCP_Assert(1);
 		if (!req->doclose)
 			req->doclose = SC_REM_CLOSE;
 		return (-1);


More information about the varnish-commit mailing list