BUG/MINOR: mux-quic: prevent quic_conn error code to be overwritten
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 4 May 2023 13:36:17 +0000 (15:36 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 4 May 2023 14:36:51 +0000 (16:36 +0200)
commitb737f9500980f13075668b8ea9607f47a02b8e08
tree2498d3e07b5a3f9ff571e9a7ca45ed16690a54c6
parent4403cdf65380756903c412472ea4186d78d7a91f
BUG/MINOR: mux-quic: prevent quic_conn error code to be overwritten

When MUX performs a graceful shutdown, quic_conn error code is set to a
"no error" code which depends on the application layer used. However,
this may overwrite a previous error code if quic_conn layer has detected
an error on its side.

In practice, this behavior has not been seen on production. In fact, it
may have undesirable effect only if this error code modification happens
between the quic_conn error detection and the emission of the
CONNECTION_CLOSE, so it should be pretty rare. However, there is still a
tiny possibility it may happen.

To prevent this, first check that quic_conn error code is not set before
setting it. Ideally, transport layer API should be adjusted to be able
to set this without fiddling with the quic_conn directly.

This should be backported up to 2.6.
src/mux_quic.c