BUG/MINOR: h2: fix reverse if no timeout defined
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 24 Aug 2023 15:32:50 +0000 (17:32 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 24 Aug 2023 15:58:14 +0000 (17:58 +0200)
commit6bd994d5d71d70128a859478f64d38e93c72a479
tree0003ad7b4df2e44be53a29d60fd2e710e70fe706
parent36d936dd155df60660c283bd047b6646025b9855
BUG/MINOR: h2: fix reverse if no timeout defined

h2c.task is not allocated in h2_init() if timeout client/server is not
defined depending on the connection side. This caused crash on
connection reverse due to systematic requeuing of h2c.task in
h2_conn_reverse().

To fix this, check h2c.task in h2_conn_reverse(). If old timeout was
undefined but new one is, h2c.task must be allocated as it was not in
h2_init(). On the opposite situation, if old timeout was defined and new
one is not, h2c.task is freed. In this case, or if neither timeout are
defined, skip the task requeuing.

This bug is easily reproduced by using reverse bind or server with
undefined timeout client/server depending on the connection reverse
direction.

This bug has been introduced by reverse connect support.
No need to backport it.
src/mux_h2.c