]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Fix condition to set LAST termination flag
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 26 Jan 2023 18:02:07 +0000 (19:02 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 13 Feb 2023 08:43:38 +0000 (09:43 +0100)
We should not report LAST data in log if the response is in TUNNEL mode on
client close/timeout because there is no way to be sure it is the last
data. It means, it can only be reported in DONE, CLOSING or CLOSE states.

No backport needed.

src/http_ana.c

index af519a5b9ac9e424b5aaeb735b4b4f1dddcd9eaf..09c374ff9c2373a3541f6e1360225d58b3ad16ed 100644 (file)
@@ -5079,8 +5079,8 @@ void http_set_term_flags(struct stream *s)
                                /* We are still processing the response headers */
                                s->flags |= SF_FINST_H;
                        }
-                       // (res >= done) & (res->flags & shutw)
-                       else if (s->txn->rsp.msg_state >= HTTP_MSG_DONE &&
+                       // (res == (done|closing|closed)) & (res->flags & shutw)
+                       else if (s->txn->rsp.msg_state >= HTTP_MSG_DONE && s->txn->rsp.msg_state < HTTP_MSG_TUNNEL &&
                                 (s->flags & (SF_ERR_CLITO|SF_ERR_CLICL))) {
                                /* A client error was reported and we are
                                 * transmitting the last block of data