]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats/htx: Respect the reserve when the stats page is dumped
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 7 Jan 2019 13:27:53 +0000 (14:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Jan 2019 15:32:10 +0000 (16:32 +0100)
As for the cache applet, this one must respect the reserve on HTX streams. This
patch is tagged as MINOR because it is unlikely to fully fill the channel's
buffer. Some tests are already done to not process almost full buffer.

This patch must be backported to 1.9.

src/stats.c

index 5e54dd5b2d8c2342b6a373de5e19ec5de81d7be6..ebd95d3f04fc2094fd36b5ea95c0670436f0c680 100644 (file)
@@ -243,6 +243,8 @@ static THREAD_LOCAL struct field stats[ST_F_TOTAL_FIELDS];
 static int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk)
 {
        if (htx) {
+               if (chk->data >= channel_htx_recv_max(chn, htx))
+                       return 0;
                if (!htx_add_data(htx, ist2(chk->area, chk->data)))
                        return 0;
                channel_add_input(chn, chk->data);