]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: Fix test on SE_FL_ERROR on the wrong entity
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 12 Apr 2023 12:20:36 +0000 (14:20 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Apr 2023 10:13:09 +0000 (12:13 +0200)
There is a bug at begining of process_stream(). The SE_FL_ERROR flag is
tested against backend stream-connector's flags instead of its SE
descriptor's flags. It is an old typo, introduced when the stream-interfaces
were replaced by the conn-streams.

This patch must be backported as far as 2.6.

src/stream.c

index 803dbe8309739928c1e63bd27212dd2f9c3bf62a..cbcdfefb4928cdb674a350634e7424bee048d1c1 100644 (file)
@@ -1782,7 +1782,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                if (!((scf->flags | scb->flags) & (SC_FL_SHUTR|SC_FL_SHUTW)) &&
                    !((req->flags | res->flags) & (CF_READ_EVENT|CF_READ_TIMEOUT|CF_WRITE_EVENT|CF_WRITE_TIMEOUT)) &&
                    !(s->flags & SF_CONN_EXP) &&
-                   !((sc_ep_get(scf) | scb->flags) & SE_FL_ERROR) &&
+                   !((sc_ep_get(scf) | sc_ep_get(scb)) & SE_FL_ERROR) &&
                    ((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {
                        scf->flags &= ~SC_FL_DONT_WAKE;
                        scb->flags &= ~SC_FL_DONT_WAKE;