]> git.kaiwu.me - haproxy.git/commitdiff
Revert "MINOR: http: add <need_eot> to trailers parsing function"
authorWilly Tarreau <w@1wt.eu>
Wed, 18 Nov 2026 09:05:19 +0000 (10:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 18 Nov 2026 09:57:24 +0000 (10:57 +0100)
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.

include/haproxy/http_htx.h
src/h1_htx.c
src/h3.c
src/http_htx.c
src/mux_h2.c

index a21d022eec799ec48d70f590b1873112f4aa65a1..cfb7bc5cb1d4fe94e5d51e8bb501de3ad7346ec4 100644 (file)
@@ -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);
index f0c0237d1a7de858ef7231a229eeb392bedb1fbb..ae848a54f086a10d3a3530e2be73ace46a164841 100644 (file)
@@ -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;
index 464b23501d9ffd558627db3d304eba6a22c4a32f..514a1c1c882ae1dfcd7551e6d054d1d0c3d7ad36 100644 (file)
--- 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;
index 23a8da2635dd1ca662732d5ffd4e1769e2200998..51853655923752af3b08ad34ed5efa3b20f0973c 100644 (file)
@@ -1978,9 +1978,7 @@ int http_cookie_merge(struct htx *htx, struct http_hdr *list, int first)
  * <htx>, 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 <need_eot> 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 <flags> is a union of HTTP_PF_*
+ * is compatible with receipt of trailers. The <flags> 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;
        }
index 3f9e33bc4747a791a388460928b941c6aaf4b526..3ae71a06597f97f27f2db469d07ee6ac671c58d9 100644 (file)
@@ -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: