]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: buffer: add a new buf_wanted dummy buffer to report failed allocations
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Nov 2014 10:55:08 +0000 (11:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:32 +0000 (23:47 +0100)
commitf2f7d6b27bd01439e02f6d5260e440029822f3ff
tree39241dc902294e6b49d9d07f34c0efce85eadca6
parent2a4b54359bff7b5c9ff6153026fb49bada325f1b
MEDIUM: buffer: add a new buf_wanted dummy buffer to report failed allocations

Doing so ensures that even when no memory is available, we leave the
channel in a sane condition. There's a special case in proto_http.c
regarding the compression, we simply pre-allocate the tmpbuf to point
to the dummy buffer. Not reusing &buf_empty for this allows the rest
of the code to differenciate an empty buffer that's not used from an
empty buffer that results from a failed allocation which has the same
semantics as a buffer full.
include/common/buffer.h
src/buffer.c
src/proto_http.c