]> git.kaiwu.me - haproxy.git/commit
REGTEST: spoe: fix the SPOP varint encoding in the mock agent
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Nov 2026 07:55:45 +0000 (08:55 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 20 Nov 2026 13:23:52 +0000 (14:23 +0100)
commitdd6e14eabc37e05e7c820b8fd9304a34a3e2dd03
treeb58a2afed87e5b7bbe9c899b6df93953f517203b
parent1318dfef8c51093c30a20ece107042056ca084bb
REGTEST: spoe: fix the SPOP varint encoding in the mock agent

The mock agent implemented a LEB128-style variable-length
integer instead of the SPOP one: the continuation shift was
off by 16 on encode and the decode masked the continuation
bytes where the reference implementation adds their full
value. The echoed max-frame-size was thus wrong (14076 instead
of 16380 with the default tune.bufsize) and only passed the
negotiation because it stayed within the accepted range. With
a smaller tune.bufsize the test would fail.

Mirror encode_varint()/decode_varint() from
include/haproxy/intops.h. Validated against the C
implementation for all values below 2000 plus larger
boundaries.
reg-tests/spoe/spoa_mock.py