From: Amaury Denoyelle Date: Tue, 16 Jun 2026 09:22:19 +0000 (+0200) Subject: MINOR: hq_interop: do not rely on stream layer for HTX stline encoding X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fhaproxy.git MINOR: hq_interop: do not rely on stream layer for HTX stline encoding 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 field. This is a better solution which completely remove the superfluous dependency between hq-interop and the stream layer. --- diff --git a/src/hq_interop.c b/src/hq_interop.c index d17dd7977..137ef2acc 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -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(""));