MINOR: buffer: make bo_getblk_nc() not return 2 for a full buffer
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Oct 2017 16:21:49 +0000 (18:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 22 Oct 2017 07:54:12 +0000 (09:54 +0200)
commit0621da5f5bbd089e3562a412d7e73cf8971030b0
tree9c2598f295092063c4cdd50fa033806f9024f7d0
parent5a1335110ceeadc9aca6783588a5ee39d431b9fa
MINOR: buffer: make bo_getblk_nc() not return 2 for a full buffer

Thus function returns the number of blocks. When a buffer is full and
properly aligned, buf->p loops back the beginning, and the test in the
code doesn't cover that specific case, so it returns two chunks, a full
one and an empty one. It's harmless but can sometimes have a small impact
on performance and definitely makes the code hard to debug.
include/common/buffer.h