From: Amaury Denoyelle Date: Thu, 27 Feb 2025 10:34:39 +0000 (+0100) Subject: MINOR: hq-interop: properly handle incomplete request X-Git-Tag: v3.2-dev7~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3cc095a011d5d4231f14cf4b1cf6d3b8cf1bcbeb;p=thirdparty%2Fhaproxy.git MINOR: hq-interop: properly handle incomplete request Extends HTTP/0.9 layer to be able to deal with incomplete requests. Instead of an error, 0 is returned. Thus, instead of a stream closure. QUIC-MUX may retry rcv_buf operation later if more data is received, similarly to HTTP/3 layer. Note that HTTP/0.9 is only used for testing and interop purpose. As such, this limitation is not considered as a bug. It is probably not worth to backport it. --- diff --git a/src/hq_interop.c b/src/hq_interop.c index 1d7821fec..caf45656b 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -23,10 +23,6 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) /* hq-interop parser does not support buffer wrapping. */ BUG_ON(b_data(b) != b_contig_data(b, 0)); - /* hq-interop parser is only done once full message is received. */ - if (!fin) - return 0; - b_alloc(&htx_buf, DB_MUX_RX); htx = htx_from_buf(&htx_buf); @@ -38,13 +34,13 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) if (!data || !HTTP_IS_SPHT(*ptr)) { fprintf(stderr, "truncated stream\n"); - return -1; + return 0; } ptr++; if (!--data) { fprintf(stderr, "truncated stream\n"); - return -1; + return 0; } if (HTTP_IS_LWS(*ptr)) { @@ -61,7 +57,7 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) if (!data) { fprintf(stderr, "truncated stream\n"); - return -1; + return 0; } path.len = ptr - path.ptr;