]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: channel: bad unlikely macro
authorThierry FOURNIER / OZON.IO <thierry.fournier@ozon.io>
Sat, 12 Nov 2016 16:39:58 +0000 (17:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2016 14:23:17 +0000 (15:23 +0100)
commit500d11e65d276e304fa6d7f7100b2e2157cbe277
treea361e5dbdebbcb7f2cb21e3da9effbc432e957f7
parent29cc11ca41c606cc04367d6ec312e9f71094ef8f
BUG/MEDIUM: channel: bad unlikely macro

The unlikely macro doesn't take in acount the condition, but only one
variable.

Must be backported in 1.6

[wt: with gcc 3.x, unlikely(x) is defined as __builtin_expect((x) != 0, 0)
 so the condition is wrong for negative numbers, which correspond to the
 case where bi_getblk_nc() has reached the end of the buffer and the
 channel is already closed. With gcc 4.x, the output is cast to unsigned long
 so the <=0 will not match negative values either. This is only used in Lua
 for now so that may explain why it hasn't hit yet]
src/channel.c