]> git.kaiwu.me - haproxy.git/commitdiff
MAJOR: htx: Rename HTX_FL_EOM into HTX_FL_HAS_EOM
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Jul 2026 13:03:22 +0000 (15:03 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Sep 2026 15:05:18 +0000 (17:05 +0200)
It is just a flag renaming but it is an API breakage and this could generate
compilation errors for all external modules relying on the HTX API. This
change was performed to force to review all code using HTX to be sure this
flag is never set by hand from outside. Indeed, htx_set_eom() function must
always be used now.

19 files changed:
include/haproxy/htx-t.h
include/haproxy/htx.h
src/fcgi-app.c
src/flt_decomp.c
src/flt_http_comp.c
src/h3.c
src/haload.c
src/hlua.c
src/hq_interop.c
src/http_ana.c
src/http_client.c
src/http_htx.c
src/htx.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/qcm_http.c
src/stats-html.c
src/tcpcheck.c

index 65571630085f3707300412f956b77db76793fd18..c404812539ae5bf7a41bc45aecc323b79e7cd67f 100644 (file)
@@ -180,7 +180,7 @@ static forceinline char *hsl_show_flags(char *buf, size_t len, const char *delim
 #define HTX_FL_PROCESSING_ERROR  0x00000002 /* Set when a processing error occurred */
 #define HTX_FL_FRAGMENTED        0x00000004 /* Set when the HTX buffer is fragmented */
 #define HTX_FL_UNORDERED         0x00000008 /* Set when the HTX buffer are not ordered */
-#define HTX_FL_EOM               0x00000010 /* Set when end-of-message is reached from the HTTP point of view */
+#define HTX_FL_HAS_EOM           0x00000010 /* Set when end-of-message is reached from the HTTP point of view */
 
 /* This function is used to report flags in debugging tools. Please reflect
  * below any single-bit flag addition above in the same order via the
@@ -193,7 +193,7 @@ static forceinline char *htx_show_flags(char *buf, size_t len, const char *delim
        _(0);
        /* flags */
        _(HTX_FL_PARSING_ERROR, _(HTX_FL_PROCESSING_ERROR,
-       _(HTX_FL_FRAGMENTED, _(HTX_FL_UNORDERED, _(HTX_FL_EOM)))));
+       _(HTX_FL_FRAGMENTED, _(HTX_FL_UNORDERED, _(HTX_FL_HAS_EOM)))));
        /* epilogue */
        _(~0U);
        return buf;
index 837b3f834ccc7c1b7386e045dab87c17606f8333..f16737aed60f2e7160e8ba2e617d18ddac90e1d2 100644 (file)
@@ -823,12 +823,12 @@ static inline int htx_is_empty_noerr(const struct htx *htx)
 
 /* Returns 1 if more data are expected for the message <htx>. Otherwise it
  * returns 0. Note that it is illegal to call this with htx == NULL. This
- * function relies on the HTX_FL_EOM flags. It means tunneled data are not
- * considered here.
+ * function relies on the HTX_FL_HAS_EOM flags. It means tunneled data are
+ * not considered here.
  */
 static inline int htx_expect_more(const struct htx *htx)
 {
-       return !(htx->flags & HTX_FL_EOM);
+       return !(htx->flags & HTX_FL_HAS_EOM);
 }
 
 /* Set EOM flag in <htx>. This function must always be called to report the end
@@ -846,7 +846,7 @@ static inline int htx_set_eom(struct htx *htx)
                        return 0;
        }
 
-       htx->flags |= HTX_FL_EOM;
+       htx->flags |= HTX_FL_HAS_EOM;
        return 1;
 }
 
index 217594cd02190f6ffd91993bdf5c2d5a63353bad..d77ae10eaeeebf939bedc0ecfec09f693e28dd06 100644 (file)
@@ -343,7 +343,7 @@ static int fcgi_flt_http_headers(struct stream *s, struct filter *filter, struct
                sl = http_get_stline(htx);
                if (s->txn.http->meth != HTTP_METH_HEAD && sl &&
                    (msg->flags & (HTTP_MSGF_XFER_LEN|HTTP_MSGF_CNT_LEN|HTTP_MSGF_TE_CHNK)) == HTTP_MSGF_XFER_LEN &&
-                   (htx->flags & HTX_FL_EOM)) {
+                   (htx->flags & HTX_FL_HAS_EOM)) {
                        struct htx_blk * blk;
                        char *end;
                        size_t len = 0;
index ce8c9687d1f6b96cdc0063f7f7a53369f1a53747..d09b650a403584e11e1513949982518141d8ad32 100644 (file)
@@ -210,9 +210,9 @@ static int decomp_stream_blk(struct stream *s, struct filter *f, struct channel
         * early to next filters. But save the information to be able to restore
         * the flag at the end of the decompression.
         */
-       if (htx->flags & HTX_FL_EOM) {
+       if (htx->flags & HTX_FL_HAS_EOM) {
                st->flags |= DECOMP_STATE_EOM_SEEN;
-               htx->flags &= ~HTX_FL_EOM;
+               htx->flags &= ~HTX_FL_HAS_EOM;
        }
 
        while (blk && len) {
@@ -415,7 +415,7 @@ static int decomp_stream_blk(struct stream *s, struct filter *f, struct channel
        return total;
 
   error:
-       /* On error, restore HTX_FL_EOM flag */
+       /* On error, restore HTX_FL_HAS_EOM flag */
        if (st->flags & DECOMP_STATE_EOM_SEEN)
                htx_set_eom(htx);
        htx_to_buf(htx, &chn->buf);
index 3267a0ba6fa7e540928509b19ad53fdb52e7fc23..f97c2328837a3737390eb45a7102fcfb7180279c 100644 (file)
@@ -129,7 +129,7 @@ comp_prepare_compress_request(struct comp_state *st, struct stream *s, struct ht
        comp_type = NULL;
 
        /* compress only if body size is >= than the min size */
-       if (((msg->flags & HTTP_MSGF_CNT_LEN) || (htx->flags & HTX_FL_EOM)) &&
+       if (((msg->flags & HTTP_MSGF_CNT_LEN) || (htx->flags & HTX_FL_HAS_EOM)) &&
            ((s->be->comp && (comp_minsize = s->be->comp->minsize_req)) ||
             (strm_fe(s)->comp && (comp_minsize = strm_fe(s)->comp->minsize_req)))) {
                /* small requests should not be compressed */
@@ -291,9 +291,9 @@ comp_http_payload(struct stream *s, struct filter *filter, struct http_msg *msg,
         * early to next filters. But save the information to be able to restore
         * the flag at the end of the compression.
         */
-       if (htx->flags & HTX_FL_EOM) {
+       if (htx->flags & HTX_FL_HAS_EOM) {
                st->flags |= COMP_STATE_EOM_SEEN;
-               htx->flags &= ~HTX_FL_EOM;
+               htx->flags &= ~HTX_FL_HAS_EOM;
        }
 
        for (next = NULL; blk && len; blk = next) {
@@ -409,9 +409,9 @@ comp_http_payload(struct stream *s, struct filter *filter, struct http_msg *msg,
        return to_forward;
 
   error:
-       /* On error, restore HTX_FL_EOM flag */
+       /* On error, restore HTX_FL_HAS_EOM flag */
        if (st->flags & COMP_STATE_EOM_SEEN)
-               htx_set_eom(htx);
+               htx->flags |= HTX_FL_HAS_EOM;
        return -1;
 }
 
@@ -695,7 +695,7 @@ select_compression_response_header(struct comp_state *st, struct stream *s, stru
                goto fail;
 
        /* compress only if body size is >= than the min size */
-       if (((msg->flags & HTTP_MSGF_CNT_LEN) || (htx->flags & HTX_FL_EOM)) &&
+       if (((msg->flags & HTTP_MSGF_CNT_LEN) || (htx->flags & HTX_FL_HAS_EOM)) &&
            ((s->be->comp && (comp_minsize = s->be->comp->minsize_res)) ||
             (strm_fe(s)->comp && (comp_minsize = strm_fe(s)->comp->minsize_res)))) {
                /* small responses should not be compressed */
index 210269f4413c3192eea9acc114874df2c9d4449b..84cac44e6b91cf04c47a7ce88293adb03b52559d 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -3160,7 +3160,7 @@ static size_t h3_snd_buf(struct qcs *qcs, struct buffer *buf, size_t count, char
        *fin = 0;
        htx = htx_from_buf(buf);
        /* EOM is saved here, useful if 0-copy is performed with HTX buf. */
-       eom = htx->flags & HTX_FL_EOM;
+       eom = htx->flags & HTX_FL_HAS_EOM;
 
        while (count && !htx_is_empty(htx) && qcc_stream_can_send(qcs) && ret >= 0) {
                idx = htx_get_head(htx);
@@ -3250,7 +3250,7 @@ static size_t h3_snd_buf(struct qcs *qcs, struct buffer *buf, size_t count, char
         * which results in transfers reported as prematurely aborted (cL--).
         */
 #if 0
-       if (unlikely((htx->flags & HTX_FL_EOM) && htx_is_empty(htx)) &&
+       if (unlikely((htx->flags & HTX_FL_HAS_EOM) && htx_is_empty(htx)) &&
                     !qcs_is_close_remote(qcs)) {
                /* Generate a STOP_SENDING if full response transferred before
                 * receiving the full request.
index 79b0b892ce42c831eaf4d551068d442865d3f3e2..9a1a83b6475579a89476a280d4a90b29ab5bb69c 100644 (file)
@@ -1228,7 +1228,7 @@ static int hldstream_build_http_req(struct hldstream *hs, struct ist path)
 }
 
 /* Continue sending the POST body once the previous output buffer was fully
- * drained but hs->to_send is still > 0. Sets HTX_FL_EOM once it reaches 0.
+ * drained but hs->to_send is still > 0. Sets HTX_FL_HAS_EOM once it reaches 0.
  * Return 1 if succeeded, 0 if not.
  */
 static int hldstream_build_http_body(struct hldstream *hs)
index cb03bb8fd0964864c2d7480d866de700ddee04a2..094e4cd99c86c26270d49ad398c3962eb4d86098 100644 (file)
@@ -5868,7 +5868,7 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K
        /* The message was fully consumed and no more data are expected
         * (EOM flag set).
         */
-       if (htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)) {
+       if (htx_is_empty(htx) && (htx->flags & HTX_FL_HAS_EOM)) {
                http_ctx->flags |= APPLET_REQ_RECV;
                stop = 1;
        }
@@ -5964,7 +5964,7 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
        /* The message was fully consumed and no more data are expected
         * (EOM flag set).
         */
-       if (htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)) {
+       if (htx_is_empty(htx) && (htx->flags & HTX_FL_HAS_EOM)) {
                http_ctx->flags |= APPLET_REQ_RECV;
                len = 0;
        }
@@ -7917,7 +7917,7 @@ __LJMP static int hlua_http_msg_unset_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->flags &= ~HTX_FL_HAS_EOM;
        return 0;
 }
 
index bd58357375c7d1bdb61ea93bf8ea0f6dcc89005a..81eaf5dd9b31e17c880e8a084f292bc6720dfafe 100644 (file)
@@ -240,7 +240,7 @@ static size_t hq_interop_snd_buf(struct qcs *qcs, struct buffer *buf,
        *fin = 0;
        htx = htx_from_buf(buf);
        /* EOM is saved here, useful if 0-copy is performed with HTX buf. */
-       eom = htx->flags & HTX_FL_EOM;
+       eom = htx->flags & HTX_FL_HAS_EOM;
 
        while (count && !htx_is_empty(htx) && qcc_stream_can_send(qcs)) {
                /* Not implemented : QUIC on backend side */
index 2bbb4abd4433633627e7a99f8b764a9896e50423..344926e8dfb2577c7d562528727be3d22bf6040f 100644 (file)
@@ -743,7 +743,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit)
         * in case we previously disabled it, otherwise we might cause
         * the client to delay further data.
         */
-       if ((sess->listener && (sess->listener->bind_conf->options & BC_O_NOQUICKACK)) && !(htx->flags & HTX_FL_EOM))
+       if ((sess->listener && (sess->listener->bind_conf->options & BC_O_NOQUICKACK)) && !(htx->flags & HTX_FL_HAS_EOM))
                conn_set_quickack(cli_conn, 1);
 
        /*************************************************************
@@ -992,7 +992,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
        else {
                c_adv(req, htx->data - co_data(req));
                if ((global.tune.options & GTUNE_USE_FAST_FWD) && (msg->flags & HTTP_MSGF_XFER_LEN) &&
-                   (!(msg->flags & HTTP_MSGF_CONN_UPG) || (htx->flags & HTX_FL_EOM)))
+                   (!(msg->flags & HTTP_MSGF_CONN_UPG) || (htx->flags & HTX_FL_HAS_EOM)))
                        channel_htx_forward_forever(req, htx);
        }
 
@@ -1003,7 +1003,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
         * in HTTP_MSG_ENDING state. Then if all data was marked to be
         * forwarded, set the state to HTTP_MSG_DONE.
         */
-       if (!(htx->flags & HTX_FL_EOM))
+       if (!(htx->flags & HTX_FL_HAS_EOM))
                goto missing_data_or_waiting;
 
        msg->msg_state = HTTP_MSG_ENDING;
@@ -2229,7 +2229,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
         * in HTTP_MSG_ENDING state. Then if all data was marked to be
         * forwarded, set the state to HTTP_MSG_DONE.
         */
-       if (!(htx->flags & HTX_FL_EOM))
+       if (!(htx->flags & HTX_FL_HAS_EOM))
                goto missing_data_or_waiting;
 
        msg->msg_state = HTTP_MSG_ENDING;
@@ -4372,7 +4372,7 @@ enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn,
        /* Now we're are waiting for the payload. We just need to know if all
         * data have been received or if the buffer is full.
         */
-       if ((htx->flags & HTX_FL_EOM) || htx_get_tail_type(htx) > HTX_BLK_DATA)
+       if ((htx->flags & HTX_FL_HAS_EOM) || htx_get_tail_type(htx) > HTX_BLK_DATA)
                goto end; /* all data received */
 
        if (bytes) {
index 2e0d1acdd095228543e7bc0687466302ad227786..4fec3f06961cc6ddd33ecb3987c7f1116a334768 100644 (file)
@@ -576,7 +576,7 @@ void httpclient_applet_io_handler(struct appctx *appctx)
                                        goto out;
                                }
 
-                               if (htx->flags & HTX_FL_EOM) { /* check if a body need to be added */
+                               if (htx->flags & HTX_FL_HAS_EOM) { /* check if a body need to be added */
                                        appctx->st0 = HTTPCLIENT_S_RES_STLINE;
                                        applet_set_eoi(appctx);
                                        goto out; /* we need to leave the IO handler once we wrote the request */
@@ -638,8 +638,8 @@ void httpclient_applet_io_handler(struct appctx *appctx)
 
                                htx = htxbuf(outbuf);
 
-                               /* if the request contains the HTX_FL_EOM, we finished the request part. */
-                               if (htx->flags & HTX_FL_EOM) {
+                               /* if the request contains the HTX_FL_HAS_EOM, we finished the request part. */
+                               if (htx->flags & HTX_FL_HAS_EOM) {
                                        appctx->st0 = HTTPCLIENT_S_RES_STLINE;
                                        applet_set_eoi(appctx);
                                        goto out; /* we need to leave the IO handler once we wrote the request */
@@ -704,7 +704,7 @@ void httpclient_applet_io_handler(struct appctx *appctx)
 
                                /* if there is no HTX data anymore and the EOM flag is
                                 * set, leave (no body) */
-                               if (htx_is_empty(htx) && htx->flags & HTX_FL_EOM)
+                               if (htx_is_empty(htx) && htx->flags & HTX_FL_HAS_EOM)
                                        appctx->st0 = HTTPCLIENT_S_RES_END;
                                else
                                        appctx->st0 = HTTPCLIENT_S_RES_HDR;
@@ -787,7 +787,7 @@ void httpclient_applet_io_handler(struct appctx *appctx)
 
                                /* if there is no HTX data anymore and the EOM flag is
                                 * set, leave (no body) */
-                               if (htx_is_empty(htx) && htx->flags & HTX_FL_EOM) {
+                               if (htx_is_empty(htx) && htx->flags & HTX_FL_HAS_EOM) {
                                        appctx->st0 = HTTPCLIENT_S_RES_END;
                                } else {
                                        appctx->st0 = HTTPCLIENT_S_RES_BODY;
@@ -869,7 +869,7 @@ void httpclient_applet_io_handler(struct appctx *appctx)
                                        hc->ops.res_payload(hc);
 
                                /* if not finished, should be called again */
-                               if ((htx_is_empty(htx) && (htx->flags & HTX_FL_EOM))) {
+                               if ((htx_is_empty(htx) && (htx->flags & HTX_FL_HAS_EOM))) {
                                        appctx->st0 = HTTPCLIENT_S_RES_END;
                                        htx_to_buf(htx, inbuf);
                                        break;
index 01ceae49a24cac607da6c943ed8e89ef825c377e..fa15875b5d021c7ce10fba4dbd2d63e6bcca9ceb 100644 (file)
@@ -2831,7 +2831,7 @@ smp_fetch_htx_has_eom(const struct arg *arg_p, struct sample *smp, const char *k
        if (!htx)
                return 0;
 
-       smp->data.u.sint = !!(htx->flags & HTX_FL_EOM);
+       smp->data.u.sint = !!(htx->flags & HTX_FL_HAS_EOM);
        smp->data.type   = SMP_T_BOOL;
        smp->flags = SMP_F_VOLATILE | SMP_F_MAY_CHANGE;
        return 1;
index 5e2052a3e0836fb9e1703e4bc9588e24904db1ae..3213301126ae7e0bf2e557f782dd3392c0631de9 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -913,7 +913,7 @@ size_t htx_xfer(struct htx *dst, struct htx *src, size_t count, unsigned int fla
 
        /* Everything was copied, transfer terminal HTX flags too */
        if (!blk) {
-               dst->flags |= (src->flags & (HTX_FL_EOM|HTX_FL_PARSING_ERROR|HTX_FL_PROCESSING_ERROR));
+               dst->flags |= (src->flags & (HTX_FL_HAS_EOM|HTX_FL_PARSING_ERROR|HTX_FL_PROCESSING_ERROR));
                if (!(flags & HTX_XFER_KEEP_SRC_BLKS))
                        src->flags = 0;
        }
@@ -1272,7 +1272,7 @@ int htx_append_msg(struct htx *dst, const struct htx *src)
                newblk->info = blk->info;
                htx_memcpy(htx_get_blk_ptr(dst, newblk), htx_get_blk_ptr(src, blk), blksz);
        }
-       dst->flags |= (src->flags & HTX_FL_EOM);
+       dst->flags |= (src->flags & HTX_FL_HAS_EOM);
        return 1;
 
   error:
index a47e741954397cb06718d508a4b4273eff5c5132..5b2d0582e28f9a6c4fd9851fe18dbc211cd3f687 100644 (file)
@@ -2192,7 +2192,7 @@ static size_t fcgi_strm_send_stdin(struct fcgi_conn *fconn, struct fcgi_strm *fs
        if (unlikely(size <= 0xFFFF && size == count && b_size(mbuf) == b_size(buf) &&
                     htx_nbblks(htx) == 1 && type == HTX_BLK_DATA)) {
                void *old_area = mbuf->area;
-               int eom = (htx->flags & HTX_FL_EOM);
+               int eom = (htx->flags & HTX_FL_HAS_EOM);
 
                 /* Last block of the message: Reserve the size for the empty stdin record */
                if (eom)
@@ -2270,7 +2270,7 @@ static size_t fcgi_strm_send_stdin(struct fcgi_conn *fconn, struct fcgi_strm *fs
                                TRACE_PROTO("sending stding data", FCGI_EV_TX_RECORD|FCGI_EV_TX_STDIN, fconn->conn, fstrm, htx, (size_t[]){size});
                                v = htx_get_blk_value(htx, blk);
 
-                               if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_EOM))
+                               if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_HAS_EOM))
                                        extra_bytes = FCGI_RECORD_HEADER_SZ; /* Last block of the message */
 
                                if (v.len > count) {
@@ -2319,7 +2319,7 @@ static size_t fcgi_strm_send_stdin(struct fcgi_conn *fconn, struct fcgi_strm *fs
        b_add(mbuf, outbuf.data);
 
        /* Send the empty stding here to finish the message */
-       if (htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)) {
+       if (htx_is_empty(htx) && (htx->flags & HTX_FL_HAS_EOM)) {
          empty_stdin:
                TRACE_PROTO("sending FCGI STDIN record", FCGI_EV_TX_RECORD|FCGI_EV_TX_STDIN, fconn->conn, fstrm, htx);
                if (!fcgi_strm_send_empty_stdin(fconn, fstrm)) {
@@ -4182,7 +4182,7 @@ static size_t fcgi_snd_buf(struct stconn *sc, struct buffer *buf, size_t count,
                 * full. Otherwise, the request is invalid.
                 */
                sl = http_get_stline(htx);
-               if (!sl || (!(sl->flags & HTX_SL_F_CLEN) && !(htx->flags & HTX_FL_EOM))) {
+               if (!sl || (!(sl->flags & HTX_SL_F_CLEN) && !(htx->flags & HTX_FL_HAS_EOM))) {
                        htx->flags |= HTX_FL_PARSING_ERROR;
                        fcgi_strm_error(fstrm);
                        goto done;
@@ -4222,7 +4222,7 @@ static size_t fcgi_snd_buf(struct stconn *sc, struct buffer *buf, size_t count,
                                        if (!ret)
                                                goto done;
                                }
-                               if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_EOM)) {
+                               if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_HAS_EOM)) {
                                        TRACE_PROTO("sending FCGI STDIN record", FCGI_EV_TX_RECORD|FCGI_EV_TX_STDIN, fconn->conn, fstrm, htx);
                                        ret = fcgi_strm_send_empty_stdin(fconn, fstrm);
                                        if (!ret)
@@ -4243,7 +4243,7 @@ static size_t fcgi_snd_buf(struct stconn *sc, struct buffer *buf, size_t count,
                                break;
 
                        case HTX_BLK_EOT:
-                               if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_EOM)) {
+                               if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_HAS_EOM)) {
                                        TRACE_PROTO("sending FCGI STDIN record", FCGI_EV_TX_RECORD|FCGI_EV_TX_STDIN, fconn->conn, fstrm, htx);
                                        ret = fcgi_strm_send_empty_stdin(fconn, fstrm);
                                        if (!ret)
index a58bf353f028d67536da5d4ddac658286b472790..68401dacc6f2253e62553cd6bc2aad3d0859ec79 100644 (file)
@@ -2843,7 +2843,7 @@ static size_t h1_make_eoh(struct h1s *h1s, struct h1m *h1m, struct htx *htx, siz
                        TRACE_STATE("force close mode (T-E + HTTP/1.0)", H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s);
                }
                else if ((h1m->flags & H1_MF_CLEN) && h1m->body_len != 0 &&
-                        htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_EOM) &&
+                        htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_HAS_EOM) &&
                         (!(h1m->flags & H1_MF_RESP) || !(h1s->flags & H1S_F_BODYLESS_RESP))) {
                        /* C-L but no data for non-bodyless response or for a request: force close */
                        h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;
@@ -2959,7 +2959,7 @@ static size_t h1_make_eoh(struct h1s *h1s, struct h1m *h1m, struct htx *htx, siz
                TRACE_STATE("1xx response xferred", H1_EV_TX_DATA|H1_EV_TX_HDRS, h1c->conn, h1s);
        }
        else if (htx_is_unique_blk(htx, blk) &&
-                ((htx->flags & HTX_FL_EOM) || ((h1m->flags & H1_MF_CLEN) && !h1m->curr_len))) {
+                ((htx->flags & HTX_FL_HAS_EOM) || ((h1m->flags & H1_MF_CLEN) && !h1m->curr_len))) {
                /* EOM flag is set and it is the last block or there is no
                 * payload. It cannot be removed now. We must emit the end of
                 * the message first to be sure the output buffer is not full.
@@ -2971,7 +2971,7 @@ static size_t h1_make_eoh(struct h1s *h1s, struct h1m *h1m, struct htx *htx, siz
                }
                else if (!chunk_memcat(&outbuf, "\r\n", 2))
                        goto full;
-               h1m->state = ((htx->flags & HTX_FL_EOM) ? H1_MSG_DONE : H1_MSG_TRAILERS);
+               h1m->state = ((htx->flags & HTX_FL_HAS_EOM) ? H1_MSG_DONE : H1_MSG_TRAILERS);
        }
        else {
                if (!chunk_memcat(&outbuf, "\r\n", 2))
@@ -3041,7 +3041,7 @@ static size_t h1_make_data(struct h1s *h1s, struct h1m *h1m, struct buffer *buf,
            htx_get_blk_value(htx, blk).len == count &&
            b_size(&h1c->obuf) == b_size(buf)) {
                void *old_area;
-               int eom = (htx->flags & HTX_FL_EOM);
+               int eom = (htx->flags & HTX_FL_HAS_EOM);
 
                old_area = h1c->obuf.area;
                h1c->obuf.area = buf->area;
@@ -3156,7 +3156,7 @@ static size_t h1_make_data(struct h1s *h1s, struct h1m *h1m, struct buffer *buf,
                                /* Get the maximum amount of data we can xferred */
                                vlen = count;
                        }
-                       else if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_EOM)) {
+                       else if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_FL_HAS_EOM)) {
                                /* It is the last block of this message. After this one,
                                 * only tunneled data may be forwarded. */
                                TRACE_DEVEL("last message block", H1_EV_TX_DATA|H1_EV_TX_BODY, h1c->conn, h1s);
index fd4c0de866563172639085629610b2bf17aea791..f875e3888c8bf05b3ec4fa73a6ba85d6f4707a41 100644 (file)
@@ -6891,7 +6891,7 @@ static size_t h2s_snd_fhdrs(struct h2s *h2s, struct htx *htx)
                /* Response already closed: add END_STREAM */
                es_now = 1;
        }
-       else if ((htx->flags & HTX_FL_EOM) && htx_is_empty(htx) && h2s->status >= 200) {
+       else if ((htx->flags & HTX_FL_HAS_EOM) && htx_is_empty(htx) && h2s->status >= 200) {
                /* EOM+empty: we may need to add END_STREAM except for 1xx
                 * responses and tunneled response.
                 */
@@ -7332,7 +7332,7 @@ static size_t h2s_snd_bhdrs(struct h2s *h2s, struct htx *htx)
                /* Request already closed: add END_STREAM */
                es_now = 1;
        }
-       if ((htx->flags & HTX_FL_EOM) && htx_is_empty(htx)) {
+       if ((htx->flags & HTX_FL_HAS_EOM) && htx_is_empty(htx)) {
                /* EOM+empty: we may need to add END_STREAM (except for CONNECT
                 * request)
                 */
@@ -7503,7 +7503,7 @@ static size_t h2s_make_data(struct h2s *h2s, struct buffer *buf, size_t count)
                        goto end;
                }
 
-               if (htx->flags & HTX_FL_EOM) {
+               if (htx->flags & HTX_FL_HAS_EOM) {
                        /* EOM+empty: we may need to add END_STREAM (except for tunneled
                         * message)
                         */
@@ -7640,7 +7640,7 @@ static size_t h2s_make_data(struct h2s *h2s, struct buffer *buf, size_t count)
        total += fsize;
        if (fsize == bsize) {
                htx_remove_blk(htx, blk);
-               if ((htx->flags & HTX_FL_EOM) && htx_is_empty(htx)) {
+               if ((htx->flags & HTX_FL_HAS_EOM) && htx_is_empty(htx)) {
                        /* EOM+empty: we may need to add END_STREAM (except for tunneled
                         * message)
                         */
@@ -7724,7 +7724,7 @@ static size_t h2s_skip_data(struct h2s *h2s, struct buffer *buf, size_t count)
        if (fsize != bsize)
                goto skip_data;
 
-       if (!(htx->flags & HTX_FL_EOM) || !htx_is_unique_blk(htx, blk))
+       if (!(htx->flags & HTX_FL_HAS_EOM) || !htx_is_unique_blk(htx, blk))
                goto skip_data;
 
        h2s->flags &= ~H2_SF_MORE_HTX_DATA;
index 1593d428e8d91e1ff99bb7b02131d63d394fbfd5..7f7cc57aa6f84047e03a456d1aaa2211c80cb27b 100644 (file)
@@ -33,7 +33,7 @@ size_t qcs_http_rcv_buf(struct qcs *qcs, struct buffer *buf, size_t count,
        cs_htx = htx_from_buf(buf);
        if (htx_is_empty_noerr(cs_htx) && htx_used_space(qcs_htx) <= count) {
                /* EOM will be copied to cs_htx via b_xfer(). */
-               if ((qcs_htx->flags & HTX_FL_EOM) &&
+               if ((qcs_htx->flags & HTX_FL_HAS_EOM) &&
                    !(qcs->flags & QC_SF_EOI_SUSPENDED)) {
                        *fin = 1;
                }
@@ -48,7 +48,7 @@ size_t qcs_http_rcv_buf(struct qcs *qcs, struct buffer *buf, size_t count,
        BUG_ON(qcs_htx->flags & HTX_FL_PARSING_ERROR);
 
        /* EOM was copied to cs_htx if all data were copied. */
-       if (cs_htx->flags & HTX_FL_EOM) {
+       if (cs_htx->flags & HTX_FL_HAS_EOM) {
                if (!(qcs->flags & QC_SF_EOI_SUSPENDED))
                        *fin = 1;
        }
index 10d77044d70e5bf0a215043c3c73c241c9a44c2f..ad018d7affbef2a11ee8a4ab05f7c1255c954a48 100644 (file)
@@ -1688,7 +1688,7 @@ static int stats_process_http_post(struct stconn *sc)
        struct htx_blk *blk;
 
        /*  we need more data */
-       if (!(htx->flags & HTX_FL_EOM)) {
+       if (!(htx->flags & HTX_FL_HAS_EOM)) {
                /* check if we can receive more */
                if (applet_fl_test(appctx, APPCTX_FL_INBLK_FULL)) {
                        ctx->st_code = STAT_STATUS_EXCD;
index 9ca6c42d6703cd1b2bf776b1521b70d7449456c9..fb4fe92b952a0387f852028a7ec432f195d602b7 100644 (file)
@@ -2000,7 +2000,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_expect_http(struct check *check, struct tcp
 
        TRACE_ENTER(CHK_EV_TCPCHK_EXP, check);
 
-       last_read |= (!htx_free_data_space(htx) || (htx->flags & HTX_FL_EOM));
+       last_read |= (!htx_free_data_space(htx) || (htx->flags & HTX_FL_HAS_EOM));
 
        if (htx->flags & HTX_FL_PARSING_ERROR) {
                TRACE_ERROR("invalid response", CHK_EV_TCPCHK_EXP|CHK_EV_TCPCHK_ERR, check);