From: Christopher Faulet Date: Mon, 15 Mar 2021 16:08:08 +0000 (+0100) Subject: MINOR: frontend: Create HTTP txn for HTX streams X-Git-Tag: v2.4-dev15~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e13ee703d2b21c85eb1587af618aced3daf9fbeb;p=thirdparty%2Fhaproxy.git MINOR: frontend: Create HTTP txn for HTX streams 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. --- diff --git a/src/frontend.c b/src/frontend.c index 1be5a0fb07..93c8a86377 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -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).