MINOR: mux-quic: disable read on CONNECTION_CLOSE emission

Similar to sending, read operations are disabled when a CONNECTION_CLOSE
frame has been emitted.

Most notably, this prevents unneeded loop demuxing when the H3 layer has
issue an error and cannot process the buffer payload anymore.

Note that read is not prevented for unidirectional streams for the
moment. This will supported soon with the unification of bidir and uni
streams treatment.
This commit is contained in:
Amaury Denoyelle 2022-05-24 14:47:48 +02:00
parent f9e190e49a
commit 5c4373a47b

View File

@ -102,7 +102,7 @@ struct trace_source trace_qmux = {
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE); INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
/* Emit a CONNECTION_CLOSE with error <err>. This will interrupt all future /* Emit a CONNECTION_CLOSE with error <err>. This will interrupt all future
* send operations. * send/receive operations.
*/ */
static void qcc_emit_cc(struct qcc *qcc, int err) static void qcc_emit_cc(struct qcc *qcc, int err)
{ {
@ -469,6 +469,11 @@ int qcc_recv(struct qcc *qcc, uint64_t id, uint64_t len, uint64_t offset,
TRACE_ENTER(QMUX_EV_QCC_RECV, qcc->conn); TRACE_ENTER(QMUX_EV_QCC_RECV, qcc->conn);
if (qcc->flags & QC_CF_CC_EMIT) {
TRACE_DEVEL("leaving on error", QMUX_EV_QCC_RECV, qcc->conn);
return 0;
}
qcs = qcc_get_qcs(qcc, id); qcs = qcc_get_qcs(qcc, id);
if (!qcs) { if (!qcs) {
if ((id >> QCS_ID_TYPE_SHIFT) <= qcc->strms[qcs_id_type(id)].largest_id) { if ((id >> QCS_ID_TYPE_SHIFT) <= qcc->strms[qcs_id_type(id)].largest_id) {
@ -1138,6 +1143,11 @@ static int qc_recv(struct qcc *qcc)
TRACE_ENTER(QMUX_EV_QCC_RECV); TRACE_ENTER(QMUX_EV_QCC_RECV);
if (qcc->flags & QC_CF_CC_EMIT) {
TRACE_DEVEL("leaving on error", QMUX_EV_QCC_RECV, qcc->conn);
return 0;
}
node = eb64_first(&qcc->streams_by_id); node = eb64_first(&qcc->streams_by_id);
while (node) { while (node) {
qcs = eb64_entry(node, struct qcs, by_id); qcs = eb64_entry(node, struct qcs, by_id);