From: Christopher Faulet Date: Thu, 23 Jul 2026 13:03:22 +0000 (+0200) Subject: MAJOR: htx: Rename HTX_FL_EOM into HTX_FL_HAS_EOM X-Git-Tag: v3.5-dev8~169 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=21706e19b4022f34d246d5381df5ece5b33cf06f;p=haproxy.git MAJOR: htx: Rename HTX_FL_EOM into HTX_FL_HAS_EOM 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. --- diff --git a/include/haproxy/htx-t.h b/include/haproxy/htx-t.h index 655716300..c40481253 100644 --- a/include/haproxy/htx-t.h +++ b/include/haproxy/htx-t.h @@ -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; diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h index 837b3f834..f16737aed 100644 --- a/include/haproxy/htx.h +++ b/include/haproxy/htx.h @@ -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 . 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 . 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; } diff --git a/src/fcgi-app.c b/src/fcgi-app.c index 217594cd0..d77ae10ea 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -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; diff --git a/src/flt_decomp.c b/src/flt_decomp.c index ce8c9687d..d09b650a4 100644 --- a/src/flt_decomp.c +++ b/src/flt_decomp.c @@ -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); diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 3267a0ba6..f97c23288 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -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 */ diff --git a/src/h3.c b/src/h3.c index 210269f44..84cac44e6 100644 --- 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. diff --git a/src/haload.c b/src/haload.c index 79b0b892c..9a1a83b64 100644 --- a/src/haload.c +++ b/src/haload.c @@ -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) diff --git a/src/hlua.c b/src/hlua.c index cb03bb8fd..094e4cd99 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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; } diff --git a/src/hq_interop.c b/src/hq_interop.c index bd5835737..81eaf5dd9 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -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 */ diff --git a/src/http_ana.c b/src/http_ana.c index 2bbb4abd4..344926e8d 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -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) { diff --git a/src/http_client.c b/src/http_client.c index 2e0d1acdd..4fec3f069 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -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; diff --git a/src/http_htx.c b/src/http_htx.c index 01ceae49a..fa15875b5 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -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; diff --git a/src/htx.c b/src/htx.c index 5e2052a3e..321330112 100644 --- 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: diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index a47e74195..5b2d0582e 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -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) diff --git a/src/mux_h1.c b/src/mux_h1.c index a58bf353f..68401dacc 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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); diff --git a/src/mux_h2.c b/src/mux_h2.c index fd4c0de86..f875e3888 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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; diff --git a/src/qcm_http.c b/src/qcm_http.c index 1593d428e..7f7cc57aa 100644 --- a/src/qcm_http.c +++ b/src/qcm_http.c @@ -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; } diff --git a/src/stats-html.c b/src/stats-html.c index 10d77044d..ad018d7af 100644 --- a/src/stats-html.c +++ b/src/stats-html.c @@ -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; diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 9ca6c42d6..fb4fe92b9 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -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);