From: Amaury Denoyelle Date: Wed, 20 Dec 2023 14:34:26 +0000 (+0100) Subject: MINOR: h3: use INTERNAL_ERROR code for init failure X-Git-Tag: v3.0-dev1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ab107b84b72c6d6b93e1b4570672d0c39c6f7d8;p=thirdparty%2Fhaproxy.git MINOR: h3: use INTERNAL_ERROR code for init failure Consider that application layer is responsible to set proper error code on init or finalize operation failure. In case of H3, use INTERNAL_ERROR application error code. This allows to remove qcc_set_error() invocation from qmux_init(). In case application layer would not specify any error code, fallback INTERNAL_ERROR transport error code would be used thanks to the recent change introduced for error management in qmux_init(). --- diff --git a/src/h3.c b/src/h3.c index 9269116640..1991e9cfcd 100644 --- a/src/h3.c +++ b/src/h3.c @@ -2216,6 +2216,7 @@ static int h3_init(struct qcc *qcc) return 1; fail_no_h3: + qcc_set_error(qcc, H3_INTERNAL_ERROR, 1); TRACE_DEVEL("leaving on error", H3_EV_H3C_NEW, qcc->conn); return 0; } @@ -2247,6 +2248,7 @@ static int h3_finalize(void *ctx) return 0; err: + qcc_set_error(qcc, H3_INTERNAL_ERROR, 1); TRACE_DEVEL("leaving on error", H3_EV_H3C_NEW, qcc->conn); return 1; } diff --git a/src/mux_quic.c b/src/mux_quic.c index a2bf855819..98d407697f 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2635,8 +2635,6 @@ static int qmux_init(struct connection *conn, struct proxy *prx, if (qcc_install_app_ops(qcc, conn->handle.qc->app_ops)) { TRACE_PROTO("Cannot install app layer", QMUX_EV_QCC_NEW|QMUX_EV_QCC_ERR, conn); - /* prepare a CONNECTION_CLOSE frame */ - qcc_set_error(qcc, QC_ERR_APPLICATION_ERROR, 0); goto err; }