]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: frontend: Create HTTP txn for HTX streams
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Mar 2021 16:08:08 +0000 (17:08 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Apr 2021 09:06:47 +0000 (11:06 +0200)
When an HTX stream is created, be sure to always create the HTTP txn object,
regardless of the ".http_needed" value of the frontend. That happens when a
destructive HTTP upgrades is performed (TCP>H2). The frontend is a TCP
proxy. If there is no dependency on the HTTP part, the HTTP transaction is
not created at this stage but only when the backend is set. For now, it is
not a problem. But an HTTP txn will be mandatory to fully support TCP to
HTTP upgrades after frontend tcp-request rules evaluation.

src/frontend.c

index 1be5a0fb071bf90fd5b84b27b24e47eab6ac4b52..93c8a8637792ec54cc4397d4c1d2d6ae19c48109 100644 (file)
@@ -145,7 +145,7 @@ int frontend_accept(struct stream *s)
                        goto out_free_reqcap;   /* no memory */
        }
 
-       if (fe->http_needed) {
+       if (fe->http_needed || IS_HTX_STRM(s)) {
                /* we have to allocate header indexes only if we know
                 * that we may make use of them. This of course includes
                 * (mode == PR_MODE_HTTP).