Permalink
Browse files

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
  • Loading branch information...
mbgrydeland committed Nov 13, 2017
1 parent 8966942 commit 8f4ff7af3cced99f777087c7525d9a5bb9edf661
Showing with 1 addition and 1 deletion.
  1. +1 −1 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);

0 comments on commit 8f4ff7a

Please sign in to comment.