From: Christopher Faulet Date: Wed, 8 Jul 2026 15:12:27 +0000 (+0200) Subject: MINOR: fcgi-app: Stop on last HTX block when getting the payload size X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=1ef1ef657d1015828a050d928a53c4ee012ae2ef;p=haproxy.git MINOR: fcgi-app: Stop on last HTX block when getting the payload size In the loop counting all DATA block to be able to add a "Content-length:" header in the FCGI response, we now check flags on the HTX block to know if it is the last one of the message or not. If HTX_BLK_FL_EOM flag is set, it means we can stop. --- diff --git a/src/fcgi-app.c b/src/fcgi-app.c index 479b1d801..81a9a4bec 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -346,10 +346,10 @@ static int fcgi_flt_http_headers(struct stream *s, struct filter *filter, struct for (blk = htx_get_first_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) { enum htx_blk_type type = htx_get_blk_type(blk); - if (type == HTX_BLK_TLR || type == HTX_BLK_EOT) - break; if (type == HTX_BLK_DATA) len += htx_get_blksz(blk); + if (type == HTX_BLK_TLR || type == HTX_BLK_EOT || (blk->flags & HTX_BLK_FL_EOM)) + break; } end = ultoa_o(len, trash.area, trash.size); if (http_add_header(htx, ist("content-length"), ist2(trash.area, end-trash.area), 0)) {