MINOR: mux-quic: report error on stream-endpoint earlier
A RESET_STREAM is emitted in several occasions :
- protocol error during HTTP/3.0 parsing
- STOP_SENDING reception
In both cases, if a stream-endpoint is attached we must set its ERR
flag. This was correctly done but after some delay as it was only when
the RESET_STREAM was emitted. Change this to set the ERR flag as soon as
one of the upper cases has been encountered. This should help to release
faster streams in error.
This should be backported up to 2.7.
diff --git a/src/mux_quic.c b/src/mux_quic.c
index 99cb37f..7c74bc4 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -883,6 +883,13 @@
TRACE_ERROR("decoding error", QMUX_EV_QCS_RECV, qcc->conn, qcs);
goto err;
}
+
+ if (qcs->flags & QC_SF_TO_RESET) {
+ if (qcs_sc(qcs) && !se_fl_test(qcs->sd, SE_FL_ERROR|SE_FL_ERR_PENDING)) {
+ se_fl_set_error(qcs->sd);
+ qcs_alert(qcs);
+ }
+ }
}
else {
TRACE_DATA("ignore read on stream", QMUX_EV_QCS_RECV, qcc->conn, qcs);
@@ -1398,6 +1405,12 @@
*/
qcc_reset_stream(qcs, err);
+ /* Report send error to stream-endpoint layer. */
+ if (qcs_sc(qcs)) {
+ se_fl_set_error(qcs->sd);
+ qcs_alert(qcs);
+ }
+
if (qcc_may_expire(qcc) && !qcc->nb_hreq)
qcc_refresh_timeout(qcc);
@@ -1816,11 +1829,6 @@
return 1;
}
- if (qcs_sc(qcs)) {
- se_fl_set_error(qcs->sd);
- qcs_alert(qcs);
- }
-
qcs_close_local(qcs);
qcs->flags &= ~QC_SF_TO_RESET;