From: Willy Tarreau Date: Wed, 18 Nov 2026 09:05:19 +0000 (+0100) Subject: Revert "MINOR: http: add to trailers parsing function" X-Git-Tag: v3.5-dev13~18 X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=40b9797f7162c5bc7cc0ed4f15f8803a5da8ebbc;p=haproxy.git Revert "MINOR: http: add to trailers parsing function" This reverts commit 6b3b676eb9878862c72bc19ed60068b553b678df. As seen with Amaury, for now this is not the right approach, we'll have to rework on it, so let's just revert it for now. --- diff --git a/include/haproxy/http_htx.h b/include/haproxy/http_htx.h index a21d022ee..cfb7bc5cb 100644 --- a/include/haproxy/http_htx.h +++ b/include/haproxy/http_htx.h @@ -74,7 +74,7 @@ int http_scheme_based_normalize(struct htx *htx); void http_cookie_register(struct http_hdr *list, int idx, int *first, int *last); int http_cookie_merge(struct htx *htx, struct http_hdr *list, int first); -enum http_parser_status http_trailers_to_htx(struct http_hdr *list, int need_eot, struct htx *htx, uint flags); +enum http_parser_status http_trailers_to_htx(struct http_hdr *list, struct htx *htx, uint flags); struct buffer *http_load_errorfile(const char *file, char **errmsg); struct buffer *http_load_errormsg(const char *key, const struct ist msg, char **errmsg); diff --git a/src/h1_htx.c b/src/h1_htx.c index f0c0237d1..ae848a54f 100644 --- a/src/h1_htx.c +++ b/src/h1_htx.c @@ -1065,7 +1065,7 @@ int h1_parse_msg_tlrs(struct h1m *h1m, struct htx *dsthtx, parser_flags = HTTP_PF_UPCASE_OK; parser_flags |= (h1m->flags & H1_MF_RESP) ? HTTP_PF_DIR_RES : 0; - if (http_trailers_to_htx(hdrs, 1, dsthtx, parser_flags) != HTTP_PRS_SUCCESS) + if (http_trailers_to_htx(hdrs, dsthtx, parser_flags) != HTTP_PRS_SUCCESS) goto error; h1m->state = H1_MSG_DONE; diff --git a/src/h3.c b/src/h3.c index 464b23501..514a1c1c8 100644 --- a/src/h3.c +++ b/src/h3.c @@ -1634,7 +1634,7 @@ static ssize_t h3_trailers_to_htx(struct qcs *qcs, const struct buffer *buf, goto out; } - prs_status = http_trailers_to_htx(list, 1, htx, (qcs->qcc->flags & QC_CF_IS_BACK) ? HTTP_PF_DIR_RES : 0); + prs_status = http_trailers_to_htx(list, htx, (qcs->qcc->flags & QC_CF_IS_BACK) ? HTTP_PF_DIR_RES : 0); switch (prs_status) { case HTTP_PRS_SUCCESS: break; diff --git a/src/http_htx.c b/src/http_htx.c index 23a8da263..518536559 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -1978,9 +1978,7 @@ int http_cookie_merge(struct htx *htx, struct http_hdr *list, int first) * , and an HTTP_PRS_SUCCESS status code is returned if some bytes were * emitted. In case of error, another code is returned, indicating the nature * of the problem. The caller must have verified that the message in the buffer - * is compatible with receipt of trailers. If is true, the EOT - * block is appended to the HTX message. Caller may want to skip it for now if - * EOM reporting needs to be delayed. The is a union of HTTP_PF_* + * is compatible with receipt of trailers. The is a union of HTTP_PF_* * describing the parser's state and permissions (direction, pseudo-headers, * etc). * @@ -1991,7 +1989,7 @@ int http_cookie_merge(struct htx *htx, struct http_hdr *list, int first) * - in all cases except the end of list, v.name and v.len must designate a * valid value. */ -enum http_parser_status http_trailers_to_htx(struct http_hdr *list, int need_eot, struct htx *htx, uint flags) +enum http_parser_status http_trailers_to_htx(struct http_hdr *list, struct htx *htx, uint flags) { uint32_t data_ofs = htx->data; /* used to rollback on error */ enum http_parser_status ret = HTTP_PRS_SUCCESS; @@ -2123,7 +2121,7 @@ enum http_parser_status http_trailers_to_htx(struct http_hdr *list, int need_eot } /* now finalize the trailers block */ - if (need_eot && !htx_add_endof(htx, HTX_BLK_EOT)) { + if (!htx_add_endof(htx, HTX_BLK_EOT)) { ret = HTTP_PRS_TOO_LARGE; goto fail; } diff --git a/src/mux_h2.c b/src/mux_h2.c index 3f9e33bc4..3ae71a065 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6665,7 +6665,7 @@ next_frame: } /* Trailers terminate a DATA sequence */ - prs_status = http_trailers_to_htx(list, 1, htx, (h2c->flags & H2_CF_IS_BACK) ? HTTP_PF_DIR_RES : 0); + prs_status = http_trailers_to_htx(list, htx, (h2c->flags & H2_CF_IS_BACK) ? HTTP_PF_DIR_RES : 0); if (prs_status != HTTP_PRS_SUCCESS) { switch (prs_status) { case HTTP_PRS_INV_HNAME: