mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 23:01:24 +02:00
MEDIUM: quic: detect the stream FIN
Set the QC_SF_FIN_STREAM on the app layers (h3 / hq-interop) when reaching the HTX EOM. This is used to warn the mux layer to set the FIN on the QUIC stream.
This commit is contained in:
parent
916f0ac1e7
commit
c2025c1ec6
@ -54,6 +54,7 @@ struct qcc {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define QC_SF_NONE 0x00000000
|
#define QC_SF_NONE 0x00000000
|
||||||
|
#define QC_SF_FIN_STREAM 0x00000001 // FIN bit must be set for last frame of the stream
|
||||||
|
|
||||||
struct qcs {
|
struct qcs {
|
||||||
struct qcc *qcc;
|
struct qcc *qcc;
|
||||||
|
3
src/h3.c
3
src/h3.c
@ -620,6 +620,9 @@ size_t h3_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((htx->flags & HTX_FL_EOM) && htx_is_empty(htx))
|
||||||
|
qcs->flags |= QC_SF_FIN_STREAM;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (total) {
|
if (total) {
|
||||||
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
|
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
|
||||||
|
@ -116,6 +116,9 @@ static size_t hq_interop_snd_buf(struct conn_stream *cs, struct buffer *buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((htx->flags & HTX_FL_EOM) && htx_is_empty(htx))
|
||||||
|
qcs->flags |= QC_SF_FIN_STREAM;
|
||||||
|
|
||||||
b_add(res, b_data(&outbuf));
|
b_add(res, b_data(&outbuf));
|
||||||
|
|
||||||
if (total) {
|
if (total) {
|
||||||
|
@ -143,8 +143,17 @@ static int qc_send(struct qcc *qcc)
|
|||||||
struct qcs *qcs = container_of(node, struct qcs, by_id);
|
struct qcs *qcs = container_of(node, struct qcs, by_id);
|
||||||
struct buffer *buf = &qcs->tx.buf;
|
struct buffer *buf = &qcs->tx.buf;
|
||||||
if (b_data(buf)) {
|
if (b_data(buf)) {
|
||||||
/* TODO handle the FIN parameter */
|
char fin = 0;
|
||||||
ret = qcs_push_frame(qcs, buf, 0, qcs->tx.offset);
|
|
||||||
|
/* if FIN is activated, ensure the buffer to
|
||||||
|
* send is the last
|
||||||
|
*/
|
||||||
|
if (qcs->flags & QC_SF_FIN_STREAM) {
|
||||||
|
BUG_ON(b_data(&qcs->tx.buf) < b_data(buf));
|
||||||
|
fin = (b_data(&qcs->tx.buf) - b_data(buf) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = qcs_push_frame(qcs, buf, fin, qcs->tx.offset);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
ABORT_NOW();
|
ABORT_NOW();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user