]> git.kaiwu.me - haproxy.git/commitdiff
MEDIUM: mux-h2: rely on the generic trailers parser
authorWilly Tarreau <w@1wt.eu>
Tue, 8 Sep 2026 08:03:20 +0000 (10:03 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 8 Sep 2026 12:50:50 +0000 (14:50 +0200)
http_trailers_to_htx() was made from h2_make_htx_trailers(), so it's
expected that we can get rid of the latter in favor of the former to
aim towards a generic parser.

For now we don't exploit the extended return codes, we only check for
HTTP_PRS_SUCCESS to detect parsing failures.

src/mux_h2.c

index d336fcad3fbba0de0a030b0fdaacbd3ab622e41d..251292e20dd7f1f727c78f5c8a5b3eaf1844d638 100644 (file)
@@ -6484,7 +6484,7 @@ next_frame:
        }
 
        /* Trailers terminate a DATA sequence */
-       if (h2_make_htx_trailers(list, htx) <= 0) {
+       if (http_trailers_to_htx(list, htx) != HTTP_PRS_SUCCESS) {
                h2c_report_glitch(h2c, 1, "failed to append HTX trailers into rxbuf");
                TRACE_STATE("failed to append HTX trailers into rxbuf", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_H2S_ERR, h2c->conn);
                htx->flags |= HTX_FL_PARSING_ERROR;