From: Christopher Faulet Date: Tue, 4 Apr 2023 08:16:57 +0000 (+0200) Subject: BUG/MINOR: stream: Fix test on channels flags to set clientfin/serverfin touts X-Git-Tag: v2.8-dev7~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=947b2e59223b53110c435ecc4d1afd75f97f1129;p=thirdparty%2Fhaproxy.git BUG/MINOR: stream: Fix test on channels flags to set clientfin/serverfin touts There is a bug in a way the channels flags are checked to set clientfin or serverfin timeout. Indeed, to set the clientfin timeout, the request channel must be shut for reads (CF_SHUTR) or the response channel must be shut for writes (CF_SHUTW). As the opposite, the serverfin timeout must be set when the request channel is shut for writes (CF_SHUTW) or the response channel is shut for reads (CF_SHUTR). It is a 2.8-dev specific issue. No backport needed. --- diff --git a/src/stream.c b/src/stream.c index d37cefab88..a0007bd088 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2424,9 +2424,9 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) if (!req->analysers && s->tunnel_timeout) { scf->ioto = scb->ioto = s->tunnel_timeout; - if ((req->flags & (CF_SHUTR|CF_SHUTW)) && tick_isset(sess->fe->timeout.clientfin)) + if (((req->flags & CF_SHUTR) || (res->flags & CF_SHUTW)) && tick_isset(sess->fe->timeout.clientfin)) scf->ioto = sess->fe->timeout.clientfin; - if ((req->flags & (CF_SHUTR|CF_SHUTW)) && tick_isset(s->be->timeout.serverfin)) + if (((res->flags & CF_SHUTR) || (req->flags & CF_SHUTW)) && tick_isset(s->be->timeout.serverfin)) scb->ioto = s->be->timeout.serverfin; } }