BUG/MINOR: peers: Wrong null "server_name" data field handling.
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 13 Nov 2019 16:50:34 +0000 (17:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 19 Nov 2019 13:48:33 +0000 (14:48 +0100)
commitaf9990f0358eb61dbec14c171ae26829932ddf19
treee003345483b0fc85e24a31fdb2b1a44370b43788
parentec1c10b8391b5d1b54de2e95f9c170c9016fe680
BUG/MINOR: peers: Wrong null "server_name" data field handling.

As the peers protocol expects to parse at least one encoded integer value for
each stick-table data field even when not configured on the local side,
about the "server_name" data field we must emit something even if it has
not been set (no server was configured for instance).
As this data field is made of first one encoded integer which is the length
of the remaining data (the dictionary cache entry), we encode the length 0
when emitting such an absent dictionary cache entry.
On the remote side, when we decode such an integer with 0 as value, we stop
parsing the data field and that's it.

Must be backported to 2.0.
src/peers.c