]> git.kaiwu.me - haproxy.git/commitdiff
MAJOR: htx: Use htx_set_eom() instead of setting HTX_FL_EOM by hand
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Jul 2026 14:13:24 +0000 (16:13 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Sep 2026 15:05:18 +0000 (17:05 +0200)
The function htx_set_eom() takes care to the HTX_FL_EOM on the HTX message,
by first adding a EOT block if the message is empty. So let's use it
wherever possible.

This commit is tagged as MAJOR because it is an API change.

18 files changed:
addons/promex/service-prometheus.c
include/haproxy/htx.h
src/cache.c
src/flt_decomp.c
src/h1_htx.c
src/h2.c
src/h3.c
src/haload.c
src/haterm.c
src/hlua.c
src/hq_interop.c
src/http_ana.c
src/http_client.c
src/http_htx.c
src/mux_fcgi.c
src/mux_h2.c
src/stats-html.c
src/tcpcheck.c

index 6b302ab3da2e7f64b2b6993983c3963763d89b15..4de3ec8e34d57d43acc6507676c10f7a237e7956 100644 (file)
@@ -2164,19 +2164,11 @@ static void promex_appctx_handle_io(struct appctx *appctx)
                        __fallthrough;
 
                case PROMEX_ST_DONE:
-                       /* no more data are expected. If the response buffer is
-                        * empty, be sure to add something (EOT block in this
-                        * case) to have something to send. It is important to
-                        * be sure the EOM flags will be handled by the
-                        * endpoint.
-                        */
-                       if (htx_is_empty(res_htx)) {
-                               if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
-                                       applet_have_more_data(appctx);
-                                       break;
-                               }
+                       /* no more data are expected */
+                       if (!htx_set_eom(res_htx)) {
+                               applet_have_more_data(appctx);
+                               break;
                        }
-                       res_htx->flags |= HTX_FL_EOM;
                        applet_set_eoi(appctx);
                        appctx->st0 = PROMEX_ST_END;
                        __fallthrough;
index bf643e49c7f83555e59e191c32a7b0c425c54e75..837b3f834ccc7c1b7386e045dab87c17606f8333 100644 (file)
@@ -831,10 +831,11 @@ static inline int htx_expect_more(const struct htx *htx)
        return !(htx->flags & HTX_FL_EOM);
 }
 
-/* Set EOM flag in <htx>. This function is useful if the HTX message is empty.
- * In this case, an EOT block is appended first to ensure the EOM will be
- * forwarded as expected. This is a workaround as it is not possibly currently
- * to push an empty HTX DATA block.
+/* Set EOM flag in <htx>. This function must always be called to report the end
+ * of the message. Corresponding flags must never be added by hand, except from
+ * the HTX API itself. It must also be called after the last block of the
+ * message was added. Finally, this function takes care to add an EOT block if
+ * the HTX message is empty.
  *
  * Returns 1 on success else 0.
  */
index dd49c66e6b8f3a291912711cf95229658f3f083a..37fff6b0f6f4b09c163f5a6834ba1e0b367a0891 100644 (file)
@@ -2274,7 +2274,7 @@ static void http_cache_io_handler(struct appctx *appctx)
 
        if (appctx->st0 == HTX_CACHE_EOM) {
                 /* no more data are expected. */
-               res_htx->flags |= HTX_FL_EOM;
+               htx_set_eom(res_htx);
                applet_set_eoi(appctx);
                se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
                applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
index d0989d0229eaa479f9d171676a9c3df4da64708a..ce8c9687d1f6b96cdc0063f7f7a53369f1a53747 100644 (file)
@@ -417,7 +417,7 @@ static int decomp_stream_blk(struct stream *s, struct filter *f, struct channel
   error:
        /* On error, restore HTX_FL_EOM flag */
        if (st->flags & DECOMP_STATE_EOM_SEEN)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
        htx_to_buf(htx, &chn->buf);
        return -1;
 }
index 5aa3ad4a840dfb6b9e9f2a6bcdbcf1928f1256ed..8b25d33cfa23e558ca71f2125f62444c15577b20 100644 (file)
@@ -202,7 +202,6 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
                h1m->flags &= ~(H1_MF_CLEN|H1_MF_CHNK);
                h1m->curr_len = h1m->body_len = 0;
                h1m->state = H1_MSG_DONE;
-               htx->flags |= HTX_FL_EOM;
        }
        else {
                if (h1sl->rq.meth == HTTP_METH_HEAD)
@@ -211,7 +210,6 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
                if (((h1m->flags & H1_MF_CLEN) && h1m->body_len == 0) ||
                    (h1m->flags & (H1_MF_XFER_LEN|H1_MF_CLEN|H1_MF_CHNK)) == H1_MF_XFER_LEN) {
                        h1m->state = H1_MSG_DONE;
-                       htx->flags |= HTX_FL_EOM;
                }
        }
 
@@ -261,8 +259,10 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
                http_scheme_based_normalize(htx);
        }
 
-  end:
+       if (h1m->state == H1_MSG_DONE)
+               htx_set_eom(htx);
        return 1;
+
   output_full:
        h1m_init_req(h1m);
        h1m->flags |= (H1_MF_NO_PHDR|H1_MF_CLEAN_CONN_HDR);
@@ -341,7 +341,6 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
                h1m->flags |= H1_MF_XFER_LEN;
                h1m->curr_len = h1m->body_len = 0;
                h1m->state = H1_MSG_DONE;
-               htx->flags |= HTX_FL_EOM;
        }
        else if ((h1m->flags & H1_MF_METH_HEAD) || (code >= 100 && code < 200) ||
                 (code == 204) || (code == 304)) {
@@ -357,10 +356,8 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
 
                h1m->flags |= H1_MF_XFER_LEN;
                h1m->curr_len = h1m->body_len = 0;
-               if (code >= 200) {
+               if (code >= 200)
                        flags |= HTX_SL_F_BODYLESS_RESP;
-                       htx->flags |= HTX_FL_EOM;
-               }
                h1m->state = H1_MSG_DONE;
        }
        else {
@@ -370,10 +367,8 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
                }
 
                if (((h1m->flags & H1_MF_CLEN) && h1m->body_len == 0) ||
-                   (h1m->flags & (H1_MF_XFER_LEN|H1_MF_CLEN|H1_MF_CHNK)) == H1_MF_XFER_LEN) {
+                   (h1m->flags & (H1_MF_XFER_LEN|H1_MF_CLEN|H1_MF_CHNK)) == H1_MF_XFER_LEN)
                        h1m->state = H1_MSG_DONE;
-                       htx->flags |= HTX_FL_EOM;
-               }
        }
 
        flags |= h1m_htx_sl_flags(h1m);
@@ -382,8 +377,10 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
                goto error;
        sl->info.res.status = code;
 
-  end:
+       if (h1m->state == H1_MSG_DONE)
+               htx_set_eom(htx);
        return 1;
+
   output_full:
        h1m_init_res(h1m);
        h1m->flags |= (H1_MF_NO_PHDR|H1_MF_CLEAN_CONN_HDR);
@@ -941,7 +938,7 @@ size_t h1_parse_msg_data(struct h1m *h1m, struct htx **dsthtx,
                total += sz;
                if (!h1m->curr_len) {
                        h1m->state = H1_MSG_DONE;
-                       (*dsthtx)->flags |= HTX_FL_EOM;
+                       htx_set_eom(*dsthtx);
                }
        }
        else if (h1m->flags & H1_MF_CHNK) {
@@ -953,7 +950,7 @@ size_t h1_parse_msg_data(struct h1m *h1m, struct htx **dsthtx,
                 * body. Switch the message in DONE state
                 */
                h1m->state = H1_MSG_DONE;
-               (*dsthtx)->flags |= HTX_FL_EOM;
+               htx_set_eom(*dsthtx);
        }
        else {
                /* no content length, read till SHUTW */
@@ -1022,7 +1019,7 @@ int h1_parse_msg_tlrs(struct h1m *h1m, struct htx *dsthtx,
                goto error;
 
        h1m->state = H1_MSG_DONE;
-       dsthtx->flags |= HTX_FL_EOM;
+       htx_set_eom(dsthtx);
 
   end:
        return ret;
index 625a02f2c758afde93f8057bfdcd7db0a7d47fcb..d2f691b6e0786bb72a64c056194f3285e0d20e93 100644 (file)
--- a/src/h2.c
+++ b/src/h2.c
@@ -483,8 +483,6 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms
            (*msgf & H2_MSGF_BODY_TUNNEL)) {
                /* Request without body or tunnel requested */
                sl_flags |= HTX_SL_F_BODYLESS;
-               if (*msgf & H2_MSGF_BODY_TUNNEL)
-                   htx->flags |= HTX_FL_EOM;
        }
 
        if (*msgf & H2_MSGF_EXT_CONNECT) {
@@ -529,6 +527,9 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms
        if (!htx_add_endof(htx, HTX_BLK_EOH))
                goto fail;
 
+       if (*msgf & H2_MSGF_BODY_TUNNEL)
+               htx_set_eom(htx);
+
        /* proceed to scheme-based normalization on target-URI */
        if (fields & H2_PHDR_FND_SCHM)
                http_scheme_based_normalize(htx);
@@ -778,8 +779,6 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m
            (*msgf & H2_MSGF_BODY_TUNNEL)) {
                /* Response without body or tunnel successfully established */
                sl_flags |= HTX_SL_F_BODYLESS;
-               if (*msgf & H2_MSGF_BODY_TUNNEL)
-                   htx->flags |= HTX_FL_EOM;
        }
 
        /* update the start line with last detected header info */
@@ -800,6 +799,9 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m
        if (!htx_add_endof(htx, HTX_BLK_EOH))
                goto fail;
 
+       if (*msgf & H2_MSGF_BODY_TUNNEL)
+               htx_set_eom(htx);
+
        ret = 1;
        return ret;
 
index ac55b7a89514b650c80a9ade46862e0374018c30..210269f4413c3192eea9acc114874df2c9d4449b 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -1176,7 +1176,7 @@ static ssize_t h3_req_headers_to_htx(struct qcs *qcs, const struct buffer *buf,
        }
 
        if (fin)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
 
        htx_to_buf(htx, &htx_buf);
        htx = NULL;
@@ -1466,7 +1466,7 @@ static ssize_t h3_resp_headers_to_htx(struct qcs *qcs, const struct buffer *buf,
        }
 
        if (fin)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
 
        /* Detect if an interim or final response was handled. */
        if (sl->info.res.status >= 100 && sl->info.res.status < 200) {
@@ -1630,7 +1630,7 @@ static ssize_t h3_trailers_to_htx(struct qcs *qcs, const struct buffer *buf,
        }
 
        if (fin)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
 
  out:
        /* HTX may be non NULL if error before previous htx_to_buf(). */
@@ -1741,7 +1741,7 @@ static ssize_t h3_data_to_htx(struct qcs *qcs, const struct buffer *buf,
        }
 
        if (fin && len == htx_sent)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
 
  out:
        if (appbuf)
index 8f90a5ff40f6d3dde75cf2aa403298ec330d0fdb..79b0b892ce42c831eaf4d551068d442865d3f3e2 100644 (file)
@@ -1215,7 +1215,7 @@ static int hldstream_build_http_req(struct hldstream *hs, struct ist path)
                hs->to_send -= hldstream_add_htx_data(hs, htx, hs->to_send);
 
        if (!hs->to_send)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
        htx_to_buf(htx, &hs->bo);
  leave:
        ret = 1;
@@ -1248,7 +1248,7 @@ static int hldstream_build_http_body(struct hldstream *hs)
        htx = htx_from_buf(buf);
        hs->to_send -= hldstream_add_htx_data(hs, htx, hs->to_send);
        if (!hs->to_send)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
        htx_to_buf(htx, &hs->bo);
  leave:
        ret = 1;
index cc3a9b2d903db2c6e4bafc36e8b509a286cd817f..654ab4c4748284199bc7d726ebe67b1e96a8992b 100644 (file)
@@ -482,7 +482,7 @@ static int hstream_build_http_help_resp(struct hstream *hs)
                goto err;
        }
 
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
        hs->flags |= HS_ST_HTTP_EOM_SENT;
        htx_to_buf(htx, buf);
        sl->info.res.status = 200;
@@ -728,7 +728,7 @@ static int hstream_build_http_resp(struct hstream *hs)
        if (hs->to_write > 0)
                hs->to_write -= hstream_add_htx_data(hs, htx, hs->to_write);
        if (hs->to_write <= 0) {
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
                hs->flags |= HS_ST_HTTP_EOM_SENT;
        }
        htx_to_buf(htx, buf);
@@ -1060,7 +1060,7 @@ static struct task *process_hstream(struct task *t, void *context, unsigned int
                if (hs->to_write > 0)
                        hs->to_write -= hstream_add_htx_data(hs, htx, hs->to_write);
                if (hs->to_write <= 0) {
-                       htx->flags |= HTX_FL_EOM;
+                       htx_set_eom(htx);
                        hs->flags |= HS_ST_HTTP_EOM_SENT;
                }
                htx_to_buf(htx, &hs->res);
index f1a73733dc6c890c0b051f1bc85e3f98e6f98963..cb03bb8fd0964864c2d7480d866de700ddee04a2 100644 (file)
@@ -7900,7 +7900,7 @@ __LJMP static int hlua_http_msg_set_eom(lua_State *L)
        MAY_LJMP(check_args(L, 1, "set_eom"));
        msg = MAY_LJMP(hlua_checkhttpmsg(L, 1));
        htx = htxbuf(&msg->chn->buf);
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
        return 0;
 }
 
@@ -8450,7 +8450,7 @@ __LJMP static int hlua_txn_forward_reply(lua_State *L, struct stream *s)
            (body_len && !htx_add_data_atonce(htx, ist2(body, body_len))))
                goto fail;
 
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
 
        /* Now, forward the response and terminate the transaction */
        s->txn.http->status = code;
@@ -11058,20 +11058,13 @@ void hlua_applet_http_fct(struct appctx *ctx)
                if (!(http_ctx->flags & APPLET_HDR_SENT))
                        goto error;
 
-               /* no more data are expected. If the response buffer is empty
-                * for a chunked message, be sure to add something (EOT block in
-                * this case) to have something to send. It is important to be
-                * sure the EOM flags will be handled by the endpoint.
-                */
+               /* no more data are expected */
                res_htx = htx_from_buf(outbuf);
-               if (htx_is_empty(res_htx)) {
-                       if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
-                               applet_have_more_data(ctx);
-                               yield = 1;
-                               goto out;
-                       }
+               if (!htx_set_eom(res_htx)) {
+                       applet_have_more_data(ctx);
+                       yield = 1;
+                       goto out;
                }
-               res_htx->flags |= HTX_FL_EOM;
                htx_to_buf(res_htx, outbuf);
                applet_set_eoi(ctx);
                applet_set_eos(ctx);
index 5ba90cfacf352b0227baba2513ca7e0a3ecf4e0e..bd58357375c7d1bdb61ea93bf8ea0f6dcc89005a 100644 (file)
@@ -109,7 +109,7 @@ static ssize_t hq_interop_rcv_buf_req(struct qcs *qcs, struct buffer *b, int fin
        sl->info.req.meth = find_http_meth(istptr(meth), 3);
 
        htx_add_endof(htx, HTX_BLK_EOH);
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
        htx_to_buf(htx, &htx_buf);
 
        hq_trace_req(meth, path, QMUX_EV_QCC_RECV, ist(TRC_LOC), __FUNCTION__, qcs, qcs->qcc);
@@ -202,7 +202,7 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin
                }
 
                if (fin && to_copy == htx_sent)
-                       htx->flags |= HTX_FL_EOM;
+                       htx_set_eom(htx);
        }
 
  out:
index bcfa4849d8521ccb9ea83e0c21366ea05d350662..2bbb4abd4433633627e7a99f8b764a9896e50423 100644 (file)
@@ -2639,7 +2639,7 @@ int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struc
        if (!htx_add_endof(htx, HTX_BLK_EOH))
                goto fail;
 
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
        htx_to_buf(htx, &res->buf);
 
        if (!(s->flags & SF_ERR_MASK))
@@ -4504,7 +4504,7 @@ void http_perform_server_redirect(struct stream *s, struct stconn *sc)
        if (!htx_add_endof(htx, HTX_BLK_EOH))
                goto fail;
 
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
        htx_to_buf(htx, &res->buf);
 
        if (!(s->flags & SF_ERR_MASK))
@@ -4801,7 +4801,8 @@ int http_forward_proxy_resp(struct stream *s, int final)
                channel_auto_close(res);
                sc_schedule_abort(s->scb);
                s->scb->flags |= SC_FL_EOI; /* The response is terminated, add EOI */
-               htxbuf(&res->buf)->flags |= HTX_FL_EOM; /* no more data are expected */
+               if (!htx_is_empty(htx))
+                       htx_set_eom(htx); /* no more data are expected */
        }
        else {
                /* Send ASAP informational messages. Rely on SC_FL_EOI for final
@@ -5020,7 +5021,7 @@ int http_reply_to_htx(struct stream *s, struct htx *htx, struct http_reply *repl
                    (body && b_data(body) && !htx_add_data_atonce(htx, ist2(b_head(body), b_data(body)))))
                        goto fail;
 
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
        }
 
   leave:
index b4a945e1f5f3ec8fd9e0238b08fa5506b85ef730..2e0d1acdd095228543e7bc0687466302ad227786 100644 (file)
@@ -168,7 +168,7 @@ int httpclient_req_gen(struct httpclient *hc, const struct ist url, enum http_me
        /* If req.payload was set, does not set the end of stream which *MUST*
         * be set in the callback */
        if (!hc->ops.req_payload)
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
 
        htx_to_buf(htx, &hc->req.buf);
 
@@ -251,17 +251,9 @@ int httpclient_req_xfer(struct httpclient *hc, struct ist src, int end)
 
        /* if we copied all the data and the end flag is set */
        if ((istlen(src) == ret) && end) {
-               /* no more data are expected. If the HTX buffer is empty, be
-                * sure to add something (EOT block in this case) to have
-                * something to send. It is important to be sure the EOM flags
-                * will be handled by the endpoint. Because the message is
-                * empty, this should not fail. Otherwise it is an error
-                */
-               if (htx_is_empty(htx)) {
-                       if (!htx_add_endof(htx, HTX_BLK_EOT))
-                               goto end;
-               }
-               htx->flags |= HTX_FL_EOM;
+               /* no more data are expected */
+               if (!htx_set_eom(htx))
+                       goto end;
        }
        htx_to_buf(htx, &hc->req.buf);
 
index bc559221b5aac3d30ab75fde837f2a67586ebdf5..01ceae49a24cac607da6c943ed8e89ef825c377e 100644 (file)
@@ -1089,8 +1089,7 @@ int http_str_to_htx(struct buffer *buf, struct ist raw, char **errmsg)
                }
                ret += sent;
        }
-
-       htx->flags |= HTX_FL_EOM;
+       htx_set_eom(htx);
 
        return 1;
 
index 9b5a20e0968773b1c53726eff35f795bd3ff3716..a47e741954397cb06718d508a4b4273eff5c5132 100644 (file)
@@ -3608,9 +3608,8 @@ static size_t fcgi_strm_parse_response(struct fcgi_strm *fstrm, struct buffer *b
                        if (!(h1m->flags & H1_MF_XFER_LEN) && fstrm->state != FCGI_SS_ERROR &&
                            (fstrm->flags & FCGI_SF_ES_RCVD) && b_data(&fstrm->rxbuf) == total) {
                                TRACE_DEVEL("end of data", FCGI_EV_RSP_DATA, fconn->conn, fstrm);
-                               if (htx_is_empty(htx) && !htx_add_endof(htx, HTX_BLK_EOT))
+                               if (!htx_set_eom(htx))
                                        break;
-                               htx->flags |= HTX_FL_EOM;
                                h1m->state = H1_MSG_DONE;
                                TRACE_USER("H1 response fully rcvd", FCGI_EV_RSP_DATA|FCGI_EV_RSP_EOM, fconn->conn, fstrm, htx);
                        }
index 2459ff7928e54a255a5c8ab4c76235d469ca8bf0..fd4c0de866563172639085629610b2bf17aea791 100644 (file)
@@ -6422,7 +6422,7 @@ next_frame:
                        goto fail;
                }
                /* no more data are expected for this message */
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
                *flags |= H2_SF_ES_RCVD;
        }
 
index 2eed3ef437e9ef2a019733aa6d82d715b56ba051..10d77044d70e5bf0a215043c3c73c241c9a44c2f 100644 (file)
@@ -2091,18 +2091,11 @@ static void http_stats_io_handler(struct appctx *appctx)
        }
 
        if (appctx->st0 == STAT_HTTP_DONE) {
-               /* no more data are expected. If the response buffer is empty,
-                * be sure to add something (EOT block in this case) to have
-                * something to send. It is important to be sure the EOM flags
-                * will be handled by the endpoint.
-                */
-               if (htx_is_empty(res_htx)) {
-                       if (!htx_add_endof(res_htx, HTX_BLK_EOT)) {
-                               applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL);
-                               goto out;
-                       }
+               /* no more data are expected */
+               if (!htx_set_eom(res_htx)) {
+                       applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL);
+                       goto out;
                }
-               res_htx->flags |= HTX_FL_EOM;
                applet_set_eoi(appctx);
                se_fl_clr(appctx->sedesc, SE_FL_MAY_FASTFWD_PROD);
                applet_fl_clr(appctx, APPCTX_FL_FASTFWD);
index 5dcd8707aaa9711abfce31112ee811169c237a01..9ca6c42d6703cd1b2bf776b1521b70d7449456c9 100644 (file)
@@ -1831,7 +1831,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_r
                        goto error_htx;
 
                /* no more data are expected */
-               htx->flags |= HTX_FL_EOM;
+               htx_set_eom(htx);
                htx_to_buf(htx, &check->bo);
                break;
        }