mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
MINOR: mux-quic: simplify empty emitted STREAM FIN handling
An empty STREAM frame can be emitted by QUIC MUX to notify about a delayed FIN. This requires tedious comparison in qmux_ctrl_send() to differentiate between the first empty frame and a retransmitted one. Simplify this by unsubscribe from streamdesc layer when the QCS is locally closed after FIN transmission. This prevents all future retransmitted frames to be notify to the QCS instance, especially any retransmitted empty FIN.
This commit is contained in:
parent
af1d170122
commit
1cae481c4c
@ -563,15 +563,19 @@ static void qmux_ctrl_send(struct qc_stream_desc *stream, uint64_t data, uint64_
|
|||||||
/* Real off MUST always be the greatest offset sent. */
|
/* Real off MUST always be the greatest offset sent. */
|
||||||
BUG_ON(offset > qcs->tx.fc.off_real);
|
BUG_ON(offset > qcs->tx.fc.off_real);
|
||||||
|
|
||||||
/* check if the STREAM frame has already been notified. It can happen
|
/* Check if the STREAM frame has already been notified. An empty FIN
|
||||||
* for retransmission. Special care must be taken to ensure an empty
|
* frame must not be considered retransmitted.
|
||||||
* STREAM frame with FIN set is not considered as retransmitted
|
|
||||||
*/
|
*/
|
||||||
if (offset + data < qcs->tx.fc.off_real || (!data && !(qcs->flags & QC_SF_FIN_STREAM))) {
|
if (data && offset + data <= qcs->tx.fc.off_real) {
|
||||||
TRACE_DEVEL("offset already notified", QMUX_EV_QCS_SEND, qcc->conn, qcs);
|
TRACE_DEVEL("offset already notified", QMUX_EV_QCS_SEND, qcc->conn, qcs);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* An empty STREAM frame is only used to notify FIN. A retransmitted
|
||||||
|
* empty FIN cannot be notified as QCS will be unsubscribed first.
|
||||||
|
*/
|
||||||
|
BUG_ON(!data && !(qcs->flags & QC_SF_FIN_STREAM));
|
||||||
|
|
||||||
qcs_idle_open(qcs);
|
qcs_idle_open(qcs);
|
||||||
|
|
||||||
diff = offset + data - qcs->tx.fc.off_real;
|
diff = offset + data - qcs->tx.fc.off_real;
|
||||||
@ -622,6 +626,9 @@ static void qmux_ctrl_send(struct qc_stream_desc *stream, uint64_t data, uint64_
|
|||||||
/* Reset flag to not emit multiple FIN STREAM frames. */
|
/* Reset flag to not emit multiple FIN STREAM frames. */
|
||||||
qcs->flags &= ~QC_SF_FIN_STREAM;
|
qcs->flags &= ~QC_SF_FIN_STREAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Unsubscribe from streamdesc when everything sent. */
|
||||||
|
qc_stream_desc_sub_send(qcs->stream, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user