Krzysztof Oledzki | cdeb9a2 | 2008-04-21 07:28:21 +0200 | [diff] [blame] | 1 | From: Krzysztof Oledzki <ole@ans.pl> |
| 2 | Date: Sun, 20 Apr 2008 22:19:09 +0200 (CEST) |
| 3 | Subject: Re: [PATCH] Flush buffers also where there are exactly 0 bytes left |
| 4 | |
| 5 | I'm also attaching a debug patch that helps to trigger this bug. |
| 6 | |
| 7 | Without 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 |
| 10 | 16384 |
| 11 | |
| 12 | With 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 |
| 15 | 33089 |
| 16 | |
| 17 | Best regards, |
| 18 | |
| 19 | diff --git a/src/dumpstats.c b/src/dumpstats.c |
| 20 | index 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 Colombier | 7af4605 | 2012-05-16 14:16:48 +0200 | [diff] [blame] | 38 | + chunk_printf(&msg, trashlen, "*"); |
Krzysztof Oledzki | cdeb9a2 | 2008-04-21 07:28:21 +0200 | [diff] [blame] | 39 | + |
David du Colombier | 7af4605 | 2012-05-16 14:16:48 +0200 | [diff] [blame] | 40 | + chunk_printf(&msg, trashlen, "\n"); |
Krzysztof Oledzki | cdeb9a2 | 2008-04-21 07:28:21 +0200 | [diff] [blame] | 41 | +#if 0 |
| 42 | if (!(s->data_ctx.stats.flags & STAT_FMT_CSV)) { |
David du Colombier | 7af4605 | 2012-05-16 14:16:48 +0200 | [diff] [blame] | 43 | chunk_printf(&msg, trashlen, |
Krzysztof Oledzki | cdeb9a2 | 2008-04-21 07:28:21 +0200 | [diff] [blame] | 44 | /* 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 Colombier | 7af4605 | 2012-05-16 14:16:48 +0200 | [diff] [blame] | 51 | chunk_printf(&msg, trashlen, |
Krzysztof Oledzki | cdeb9a2 | 2008-04-21 07:28:21 +0200 | [diff] [blame] | 52 | /* pxid, name, queue cur, queue max, */ |
| 53 | |
| 54 | |