]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: use INTERNAL_ERROR code for init failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 Dec 2023 14:34:26 +0000 (15:34 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 Dec 2023 14:40:02 +0000 (15:40 +0100)
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().

src/h3.c
src/mux_quic.c

index 92691166405eaa89f93d2f39e54ebc7ab038f6d7..1991e9cfcd44e99171dc305ed5ca636e3638d8ab 100644 (file)
--- 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;
 }
index a2bf855819782eb00eea4e44a3c4daba4d8ebd31..98d407697f4a699352cf5cdc254f2dea1fa90295 100644 (file)
@@ -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;
        }