]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2: consistently rely on the htx variable to detect the mode
authorWilly Tarreau <w@1wt.eu>
Thu, 31 Jan 2019 06:23:00 +0000 (07:23 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Jan 2019 07:07:17 +0000 (08:07 +0100)
In h2_frt_transfer_data(), we support both HTX and legacy modes. The
HTX mode is detected from the proxy option and sets a valid pointer
into the htx variable. Better rely on this variable in all the function
rather than testing the option again. This way the code is clearer and
even the compiler knows this pointer is valid when it's dereferenced.

This should be backported to 1.9 if the b_is_null() patch is backported.

src/mux_h2.c

index 51e3ee9e712e0fd9c4bbcc9a82acea988ec3e05b..dc91756dc78436240f875873a2e7a3a596d8aae6 100644 (file)
@@ -3524,7 +3524,7 @@ try_again:
                        goto fail;
        }
 
-       if (h2c->proxy->options2 & PR_O2_USE_HTX) {
+       if (htx) {
                block1 = htx_free_data_space(htx);
                if (!block1) {
                        h2c->flags |= H2_CF_DEM_SFULL;