]> git.kaiwu.me - haproxy.git/commit
[BUG] Flush buffers also where there are exactly 0 bytes left
authorKrzysztof Piotr Oledzki <ole@ans.pl>
Sun, 20 Apr 2008 19:34:47 +0000 (21:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Apr 2008 05:24:39 +0000 (07:24 +0200)
commitf86aac797720c80d9660e7d79cd532e296bac7c2
treeb6084b5bad637d7e2ad31c2c20c8652f517e742c
parentc8a91d2a007b33516105fea29badec147a856760
[BUG] Flush buffers also where there are exactly 0 bytes left

I noticed it was possible to get truncated http/csv stats. Sometimes.
Usually the problem disappeared as fast as it appeared, but once it
happend that my http-stats page was truncated for about one hour.
It was quite weird as it happened independently for csv and http
output and it took me some time to track & fix this bug.

Both buffer_write & buffer_write_chunk used to return 0 in two
situations: is case of success or where there was exactly 0 bytes
left. The first one is intentional but I believe the second one
is not as it was not possible to distinguish between successful
write and unsuccessful one, which means that if the buffer was 100%
filled, it was never flushed and it was not possible to write
more data.

This patch fixes this problem.
src/buffers.c
src/dumpstats.c