]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: quic: streamline error notification
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 10 May 2023 09:57:40 +0000 (11:57 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 May 2023 12:04:51 +0000 (14:04 +0200)
commitb2e31d33f55f3ffd690de99a3445722c48894105
tree2d597a122b9eacc823ba05a3868b8d4faadd210a
parent2ad41b862904b953a2916f18e464fa42413bfb64
MEDIUM: quic: streamline error notification

When an error is detected at quic-conn layer, the upper MUX must be
notified. Previously, this was done relying on quic_conn flag
QUIC_FL_CONN_NOTIFY_CLOSE set and the MUX wake callback called on
connection closure.

Adjust this mechanism to use an approach more similar to other transport
layers in haproxy. On error, connection flags are updated with
CO_FL_ERROR, CO_FL_SOCK_RD_SH and CO_FL_SOCK_WR_SH. The MUX is then
notified when the error happened instead of just before the closing. To
reflect this change, qc_notify_close() has been renamed qc_notify_err().
This function must now be explicitely called every time a new error
condition arises on the quic_conn layer.

To ensure MUX send is disabled on error, qc_send_mux() now checks
CO_FL_SOCK_WR_SH. If set, the function returns an error. This should
prevent the MUX from sending data on closing or draining state.

To complete this patch, MUX layer must now check for CO_FL_ERROR
explicitely. This will be the subject of the following commit.

This should be backported up to 2.7.
include/haproxy/quic_conn-t.h
include/haproxy/quic_conn.h
src/mux_quic.c
src/quic_conn.c