]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua: fix extra 500ms added to socket timeouts
authorCyril Bonté <cyril.bonte@free.fr>
Sun, 19 Aug 2018 20:08:50 +0000 (22:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 19 Aug 2018 20:11:28 +0000 (22:11 +0200)
commit7ee465f1ad1ecdc3685d152ba9f71110b8e06c09
treeb9f8ddd0c1d02ba70f3a6121224b1a3e22affb23
parent7bb634549794298fc701d33efd93c7289dcf9cb7
BUG/MINOR: lua: fix extra 500ms added to socket timeouts

Since commit #56cc12509, haproxy accepts double values for timeouts. The
value is then converted to  milliseconds before being rounded up and cast
to int. The issue is that to round up the value, a constant value of 0.5
is added to it, but too early in the conversion, resulting in an
additional 500ms to the value. We are talking about a precision of 1ms,
so we can safely get rid of this rounding trick and adjust resulting
timeouts equal to 0 to a minimum of 1ms.

This patch is specific to the 1.9 branch and doesn't require to be
backported.
src/hlua.c