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.
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;
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(""));