]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: buffers: Fix bi/bo_contig_space to handle full buffers
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 13 Jun 2017 20:00:22 +0000 (22:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 14 Jun 2017 14:20:20 +0000 (16:20 +0200)
commita36b311b9f1eee33ac42b008858c1adc1763a791
tree9df72501312f6085fd00b564e2f5d9de6de76a87
parent6a0bca9e7862984b0edf8fc1e1edc54295a7a5e2
BUG/MINOR: buffers: Fix bi/bo_contig_space to handle full buffers

These functions was added in commit 637f8f2c ("BUG/MEDIUM: buffers: Fix how
input/output data are injected into buffers").

This patch fixes hidden bugs. When a buffer is full (buf->i + buf->o ==
buf->size), instead of returning 0, these functions can return buf->size. Today,
this never happens because callers already check if the buffer is full before
calling bi/bo_contig_space. But to avoid possible bugs if calling conditions
changed, we slightly refactored these functions.
include/common/buffer.h