From: Christopher Faulet Date: Fri, 6 Nov 2020 14:23:39 +0000 (+0100) Subject: MINOR: config/mux-h2: Return ERR_ flags from init_h2() instead of a status X-Git-Tag: v2.4-dev1~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5214099233d99b8288fb392dfe911bc9ea86e9af;p=thirdparty%2Fhaproxy.git MINOR: config/mux-h2: Return ERR_ flags from init_h2() instead of a status post-check function callbacks must return ERR_* flags. Thus, init_h2() is fixed to return ERR_NONE on success or (ERR_ALERT|ERR_FATAL) on error. This patch may be backported as far as 2.2. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 740e255552..482c6205dd 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6398,9 +6398,11 @@ static int init_h2() pool_head_hpack_tbl = create_pool("hpack_tbl", h2_settings_header_table_size, MEM_F_SHARED|MEM_F_EXACT); - if (!pool_head_hpack_tbl) - return -1; - return 0; + if (!pool_head_hpack_tbl) { + ha_alert("failed to allocate hpack_tbl memory pool\n"); + return (ERR_ALERT | ERR_FATAL); + } + return ERR_NONE; } REGISTER_POST_CHECK(init_h2);