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().
This commit is contained in:
Amaury Denoyelle 2023-12-20 15:34:26 +01:00
parent 7a3602a1f5
commit 9ab107b84b
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View 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;
}