From: Willy Tarreau Date: Thu, 31 Jan 2019 06:23:00 +0000 (+0100) Subject: MINOR: mux-h2: consistently rely on the htx variable to detect the mode X-Git-Tag: v2.0-dev1~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9b7796862e2ab61745d142dde82e615407fee46;p=thirdparty%2Fhaproxy.git MINOR: mux-h2: consistently rely on the htx variable to detect the mode 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. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 51e3ee9e71..dc91756dc7 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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;