]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config/mux-h2: Return ERR_ flags from init_h2() instead of a status
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Nov 2020 14:23:39 +0000 (15:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Nov 2020 15:26:10 +0000 (16:26 +0100)
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.

src/mux_h2.c

index 740e2555528030e0814e8d18bd6517112ecb3eff..482c6205dd653d347eeef93971da24cabfb013fa 100644 (file)
@@ -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);