From: Olivier Houchard Date: Fri, 28 Sep 2018 12:38:51 +0000 (+0200) Subject: BUG/MEDIUM: process_stream(): Don't wake the task if no new data was received. X-Git-Tag: v1.9-dev3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d48d6d284ed6165dae2e3e97c2f72ed77a828622;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: process_stream(): Don't wake the task if no new data was received. At the eand of process_stream(), we wake the task if there's something in the input buffer, after attempting a recv. However this is wrong, and we should only do so if we received new data. Just check the CF_READ_PARTIAL flag. This is 1.9-specific and should not be backported. --- diff --git a/src/stream.c b/src/stream.c index e75491e5ac..266f3b1636 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2504,13 +2504,13 @@ struct task *process_stream(struct task *t, void *context, unsigned short state) if (cs && !(cs->conn->flags & CO_FL_ERROR)) { ret |= si_cs_send(cs); si_cs_recv(cs); - ret |= (ci_data(si_ic(si_f)) != 0 ) | (cs->conn->flags & CO_FL_ERROR); + ret |= (si_ic(si_f)->flags & CF_READ_PARTIAL) | (cs->conn->flags & CO_FL_ERROR); } cs = objt_cs(si_b->end); if (cs && !(cs->conn->flags & CO_FL_ERROR)) { ret |= si_cs_send(cs); si_cs_recv(cs); - ret |= (ci_data(si_ic(si_b)) != 0 ) | (cs->conn->flags & CO_FL_ERROR); + ret |= (si_ic(si_b)->flags & CF_READ_PARTIAL) | (cs->conn->flags & CO_FL_ERROR); } if (ret)