blob: 223df2c365564e1b4879a1f361d9f51b8e0a972c [file] [log] [blame]
Krzysztof Oledzkicdeb9a22008-04-21 07:28:21 +02001From: Krzysztof Oledzki <ole@ans.pl>
2Date: Sun, 20 Apr 2008 22:19:09 +0200 (CEST)
3Subject: Re: [PATCH] Flush buffers also where there are exactly 0 bytes left
4
5I'm also attaching a debug patch that helps to trigger this bug.
6
7Without the fix:
8# echo -ne "GET /haproxy?stats;csv;norefresh HTTP/1.0\r\n\r\n"|nc 127.0.0.1=
9 801|wc -c
1016384
11
12With the fix:
13# echo -ne "GET /haproxy?stats;csv;norefresh HTTP/1.0\r\n\r\n"|nc 127.0.0.1=
14 801|wc -c
1533089
16
17Best regards,
18
19diff --git a/src/dumpstats.c b/src/dumpstats.c
20index ddadddd..28bbfce 100644
21--- a/src/dumpstats.c
22+++ b/src/dumpstats.c
23@@ -593,6 +593,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri)
24
25 msg.len = 0;
26 msg.str = trash;
27+ int i;
28
29 switch (s->data_ctx.stats.px_st) {
30 case DATA_ST_PX_INIT:
31@@ -667,6 +668,13 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri)
32 /* print the frontend */
33 if ((px->cap & PR_CAP_FE) &&
34 (!(s->data_ctx.stats.flags & STAT_BOUND) || (s->data_ctx.stats.type & (1 << STATS_TYPE_FE)))) {
35+
36+ if (1) {
37+ for (i=0; i<16096; i++)
David du Colombier7af46052012-05-16 14:16:48 +020038+ chunk_printf(&msg, trashlen, "*");
Krzysztof Oledzkicdeb9a22008-04-21 07:28:21 +020039+
David du Colombier7af46052012-05-16 14:16:48 +020040+ chunk_printf(&msg, trashlen, "\n");
Krzysztof Oledzkicdeb9a22008-04-21 07:28:21 +020041+#if 0
42 if (!(s->data_ctx.stats.flags & STAT_FMT_CSV)) {
David du Colombier7af46052012-05-16 14:16:48 +020043 chunk_printf(&msg, trashlen,
Krzysztof Oledzkicdeb9a22008-04-21 07:28:21 +020044 /* name, queue */
45@@ -694,6 +702,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri)
46 px->failed_req,
47 px->state == PR_STRUN ? "OPEN" :
48 px->state == PR_STIDLE ? "FULL" : "STOP");
49+#endif
50 } else {
David du Colombier7af46052012-05-16 14:16:48 +020051 chunk_printf(&msg, trashlen,
Krzysztof Oledzkicdeb9a22008-04-21 07:28:21 +020052 /* pxid, name, queue cur, queue max, */
53
54