]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: buffer: always assign a dummy empty buffer to channels
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Nov 2014 10:39:34 +0000 (11:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:32 +0000 (23:47 +0100)
commit2a4b54359bff7b5c9ff6153026fb49bada325f1b
treebf72eb1763ec2448dad0ab9a97a785a2c52aba81
parent7dfca9daec51f847d2e8ffa8236bd1e5ee9e8b08
MEDIUM: buffer: always assign a dummy empty buffer to channels

Channels are now created with a valid pointer to a buffer before the
buffer is allocated. This buffer is a global one called "buf_empty" and
of size zero. Thus it prevents any activity from being performed on
the buffer and still ensures that chn->buf may always be dereferenced.
b_free() also resets the buffer to &buf_empty, and was split into
b_drop() which does not reset the buffer.
include/common/buffer.h
include/proto/channel.h
src/buffer.c