]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: peers: A bit of optimization when encoding cached server names.
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 7 Jun 2019 08:34:04 +0000 (10:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Jun 2019 13:47:54 +0000 (15:47 +0200)
commitfd827937edbeaa3bea3c17bf6a9c25b5fbbe73f1
tree3c452076357ae8f1140262151896504ef8fd35f6
parent99de1d0479c35229acf01feeabfe4e7c8c3dd7da
MINOR: peers: A bit of optimization when encoding cached server names.

When a server name is cached we only send its cache entry ID which has
an encoded length of 1 (because smaller than PEER_ENC_2BYTES_MIN).
So, in this case we only have to encode 1, the already known encoded length
of this ID before encoding it.

Furthermore we do not have to call strlen() to compute the lengths of server
name strings thanks to this commit: "MINOR: dict: Store the length of the
dictionary entries".
src/peers.c