]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: peers: Replace hard-coded for peer protocol 64-bits value encoding by macros.
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 3 Jun 2019 16:29:51 +0000 (18:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Jun 2019 06:42:36 +0000 (08:42 +0200)
commit32b5573b132b9a7ff1e10fda691d6a540252a67b
treefe59a2bf39f06afbead7866c0e809d59e32ca1dd
parent62b0b0bc02f396cf0513417b726cc90babd63968
MINOR: peers: Replace hard-coded for peer protocol 64-bits value encoding by macros.

With this patch we define macros for the minimum values which are
encoded for 2 up to 10 bytes. This latter is big enough to encode
UINT64_MAX. We replaced at several places 240 value by PEER_ENC_2BYTES_MIN
which is the minimum value which is encoded with 2 bytes. The peer protocol
encoding consisting in encoding with only one byte a value which is
less than PEER_ENC_2BYTES_MIN and with at least 2 bytes a 64-bits value greater
than PEER_ENC_2BYTES_MIN.
src/peers.c