[master] 8f4ff7a Use the idle read timeout only on empty requests

Martin Blix Grydeland martin at varnish-software.com
Tue Nov 14 10:16:04 UTC 2017


commit 8f4ff7af3cced99f777087c7525d9a5bb9edf661
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Nov 13 15:51:11 2017 +0100

    Use the idle read timeout only on empty requests
    
    We only want to return the connection early to the waiter when the
    request is empty. Correct the read timeout calculation to reflect
    that.
    
    Thanks to Stackpath for helping to debug this issue.
    
    Fixes: #2492

diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 455788b..0ddd0f5 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -290,7 +290,7 @@ HTC_RxStuff(struct http_conn *htc, htc_complete_f *func,
 			WRONG("htc_status_e");
 
 		tmo = tn - now;
-		if (!isnan(ti) && ti < tn)
+		if (!isnan(ti) && ti < tn && hs == HTC_S_EMPTY)
 			tmo = ti - now;
 		z = maxbytes - (htc->rxbuf_e - htc->rxbuf_b);
 		assert(z >= 0);


More information about the varnish-commit mailing list