mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-16 23:10:59 -04:00
MINOR: mux_quic: adjust shut stream callback
Clean up MUX QUIC stream shut callback with a central invokation for lclose app_ops. Also, traces are added at H3 layer to log the method of closure.
This commit is contained in:
parent
f2014ec474
commit
cc56803799
2 changed files with 12 additions and 4 deletions
6
src/h3.c
6
src/h3.c
|
|
@ -3289,19 +3289,23 @@ static void h3_lclose(struct qcs *qcs, enum qcc_app_ops_lclose_mode mode)
|
|||
* the connection with H3_FRAME_UNEXPECTED.
|
||||
*/
|
||||
if (qcs->tx.fc.off_soft) {
|
||||
TRACE_STATE("close stream with empty fin", H3_EV_H3S_END, qcs->qcc->conn, qcs);
|
||||
qcs->flags |= QC_SF_FIN_STREAM;
|
||||
qcc_send_stream(qcs, 0, 0);
|
||||
}
|
||||
else {
|
||||
qcc_reset_stream(qcs, 0, se_tevt_type_shutw);
|
||||
TRACE_STATE("reset stream as no content emitted yet", H3_EV_H3S_END, qcs->qcc->conn, qcs);
|
||||
qcc_reset_stream(qcs, H3_ERR_REQUEST_CANCELLED, se_tevt_type_shutw);
|
||||
}
|
||||
break;
|
||||
|
||||
case QCC_APP_OPS_LCLO_MODE_ABORT:
|
||||
TRACE_STATE("cancel stream", H3_EV_H3S_END, qcs->qcc->conn, qcs);
|
||||
qcc_reset_stream(qcs, H3_ERR_REQUEST_CANCELLED, se_tevt_type_cancelled);
|
||||
break;
|
||||
|
||||
case QCC_APP_OPS_LCLO_MODE_KILL_CONN:
|
||||
TRACE_STATE("kill stream", H3_EV_H3S_END, qcs->qcc->conn, qcs);
|
||||
qcc_reset_stream(qcs, H3_ERR_EXCESSIVE_LOAD, se_tevt_type_cancelled);
|
||||
if (!(qcs->qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL))) {
|
||||
qcc_set_error(qcs->qcc, H3_ERR_EXCESSIVE_LOAD, 1,
|
||||
|
|
|
|||
|
|
@ -4704,6 +4704,7 @@ static void qcm_strm_shut(struct stconn *sc, unsigned int mode, struct se_abort_
|
|||
{
|
||||
struct qcs *qcs = __sc_mux_strm(sc);
|
||||
struct qcc *qcc = qcs->qcc;
|
||||
enum qcc_app_ops_lclose_mode lclo_mode;
|
||||
|
||||
if (!(mode & (SE_SHW_SILENT|SE_SHW_NORMAL)))
|
||||
return;
|
||||
|
|
@ -4713,12 +4714,15 @@ static void qcm_strm_shut(struct stconn *sc, unsigned int mode, struct se_abort_
|
|||
/* Early closure reported if QC_SF_FIN_STREAM not yet set. */
|
||||
if (!qcs_is_close_local(qcs) &&
|
||||
!(qcs->flags & (QC_SF_FIN_STREAM|QC_SF_TO_RESET))) {
|
||||
|
||||
if (qcs->flags & QC_SF_UNKNOWN_PL_LENGTH)
|
||||
qcc->app_ops->lclose(qcs, QCC_APP_OPS_LCLO_MODE_NORMAL);
|
||||
lclo_mode = QCC_APP_OPS_LCLO_MODE_NORMAL;
|
||||
else if (se_fl_test(qcs->sd, SE_FL_KILL_CONN))
|
||||
qcc->app_ops->lclose(qcs, QCC_APP_OPS_LCLO_MODE_KILL_CONN);
|
||||
lclo_mode = QCC_APP_OPS_LCLO_MODE_KILL_CONN;
|
||||
else
|
||||
qcc->app_ops->lclose(qcs, QCC_APP_OPS_LCLO_MODE_ABORT);
|
||||
lclo_mode = QCC_APP_OPS_LCLO_MODE_ABORT;
|
||||
|
||||
qcc->app_ops->lclose(qcs, lclo_mode);
|
||||
tasklet_wakeup(qcc->wait_event.tasklet);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue