[MEDIUM] report error on buffer writes larger than buffer size
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Aug 2009 05:19:39 +0000 (07:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Aug 2009 05:19:39 +0000 (07:19 +0200)
commit078e29495aea1ddf1cb8a21ae8875f1cb922e01f
tree4e13facd4e2e54245f4c89fd9c44c1ccc9b630fb
parent27a674efb84bde8c045b87c9634f123e2f8925dc
[MEDIUM] report error on buffer writes larger than buffer size

Since it's now possible to change the buffer size by configuration,
we have to take special measures against writes that are larger than
the buffer size. Before this patch, the writers would indefinitely
block, waiting for some space to free up.

With this patch, the functions simply reject the data with an
appropriate code so that the writers can either detect and process
the error or go on, but never remain blocked.

This has been tested on the stats page which does no longer hang
with buffer sizes smaller than 2.5 kB (256 bytes is even OK for
the CSV version).
src/buffers.c