]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: hq_interop: do not rely on stream layer for HTX stline encoding master quic-interop flx04/master
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 16 Jun 2026 09:22:19 +0000 (11:22 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Jun 2026 12:53:21 +0000 (14:53 +0200)
HTTP/0.9 is a simple protocol. The response only contains the body
without any status line nor header. An HTX start line must be built when
transcoding the message for haproxy stream layer on the first invocation
of rcv_buf() callback.

Previously, this condition was detected by using an access to the stream
object. However, it's possible to rely only on the QCS by checking the
value from <rx.offset> field. This is a better solution which completely
remove the superfluous dependency between hq-interop and the stream
layer.

src/hq_interop.c

index d17dd7977c8af5fbd608651840be9775da6932f0..137ef2accde29d93f51b6ecadccff435ae135ba2 100644 (file)
@@ -115,7 +115,6 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin
        struct htx *htx;
        struct htx_sl *sl;
        struct buffer *htx_buf;
-       const struct stream *strm = __sc_strm(qcs->sd->sc);
        const unsigned int flags = HTX_SL_F_VER_11|HTX_SL_F_XFER_LEN;
        size_t to_copy = b_data(b);
        size_t htx_sent = 0;
@@ -125,7 +124,7 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin
        BUG_ON(!htx_buf);
        htx = htx_from_buf(htx_buf);
 
-       if (htx_is_empty(htx) && !strm->scb->bytes_in) {
+       if (htx_is_empty(htx) && !qcs->rx.offset) {
                /* First data transfer, add HTX response start-line first. */
                sl = htx_add_stline(htx, HTX_BLK_RES_SL, flags,
                                    ist("HTTP/1.0"), ist("200"), ist(""));