mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-17 12:35:37 +00:00
MINOR: quic: add HTX EOM on request end
Set the HTX EOM flag on RX the app layer. This is required to notify about the end of the request for the stream analyzers, else the request channel never goes to MSG_DONE state.
This commit is contained in:
parent
fecfa0d822
commit
db44338473
@ -85,7 +85,7 @@ struct qcs {
|
||||
struct qcc_app_ops {
|
||||
int (*init)(struct qcc *qcc);
|
||||
int (*attach_ruqs)(struct qcs *qcs, void *ctx);
|
||||
int (*decode_qcs)(struct qcs *qcs, void *ctx);
|
||||
int (*decode_qcs)(struct qcs *qcs, int fin, void *ctx);
|
||||
size_t (*snd_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags);
|
||||
int (*finalize)(void *ctx);
|
||||
};
|
||||
|
@ -149,6 +149,7 @@ struct quic_stream {
|
||||
struct buffer *buf;
|
||||
struct eb64_node offset;
|
||||
uint64_t len;
|
||||
int fin;
|
||||
const unsigned char *data;
|
||||
};
|
||||
|
||||
|
5
src/h3.c
5
src/h3.c
@ -96,7 +96,7 @@ static inline size_t h3_decode_frm_header(uint64_t *ftype, uint64_t *flen,
|
||||
/* Decode <qcs> remotely initiated bidi-stream.
|
||||
* Returns <0 on error else 0.
|
||||
*/
|
||||
static int h3_decode_qcs(struct qcs *qcs, void *ctx)
|
||||
static int h3_decode_qcs(struct qcs *qcs, int fin, void *ctx)
|
||||
{
|
||||
struct buffer *rxbuf = &qcs->rx.buf;
|
||||
struct h3 *h3 = ctx;
|
||||
@ -220,6 +220,9 @@ static int h3_decode_qcs(struct qcs *qcs, void *ctx)
|
||||
b_del(rxbuf, flen);
|
||||
}
|
||||
|
||||
if (fin && !b_data(rxbuf))
|
||||
htx->flags |= HTX_FL_EOM;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <haproxy/mux_quic-t.h>
|
||||
#include <haproxy/stream.h>
|
||||
|
||||
static int hq_interop_decode_qcs(struct qcs *qcs, void *ctx)
|
||||
static int hq_interop_decode_qcs(struct qcs *qcs, int fin, void *ctx)
|
||||
{
|
||||
struct buffer *rxbuf = &qcs->rx.buf;
|
||||
struct htx *htx;
|
||||
@ -54,6 +54,9 @@ static int hq_interop_decode_qcs(struct qcs *qcs, void *ctx)
|
||||
b_del(rxbuf, b_data(rxbuf));
|
||||
b_free(&htx_buf);
|
||||
|
||||
if (fin)
|
||||
htx->flags |= HTX_FL_EOM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -427,6 +427,8 @@ static int quic_parse_stream_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
else if (!quic_dec_int(&stream->len, buf, end) || end - *buf < stream->len)
|
||||
return 0;
|
||||
|
||||
stream->fin = (frm->type & QUIC_STREAM_FRAME_TYPE_FIN_BIT);
|
||||
|
||||
stream->data = *buf;
|
||||
*buf += stream->len;
|
||||
|
||||
|
@ -2076,7 +2076,7 @@ static int qc_handle_bidi_strm_frm(struct quic_rx_packet *pkt,
|
||||
goto store_frm;
|
||||
|
||||
ret = qc_strm_cpy(&strm->rx.buf, strm_frm);
|
||||
if (ret && qc->qcc->app_ops->decode_qcs(strm, qc->qcc->ctx) < 0) {
|
||||
if (ret && qc->qcc->app_ops->decode_qcs(strm, strm_frm->fin, qc->qcc->ctx) < 0) {
|
||||
TRACE_PROTO("Decoding error", QUIC_EV_CONN_PSTRM);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user