From: Olivier Houchard Date: Wed, 18 Nov 2026 10:07:49 +0000 (+0100) Subject: MINOR: peers: move message length constants to peers-t.h X-Git-Tag: v3.5-dev13~3 X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=88017c5632ef71742b0a4dcb89141eabdf4af402;p=haproxy.git MINOR: peers: move message length constants to peers-t.h PEER_MSG_HEADER_LEN and PEER_MSG_ENC_LENGTH_MAXLEN are needed by the stick-table code to estimate the size of update messages, so let's move them out of peers.c. This is needed by the next commit, so it must be backported along with it. --- diff --git a/include/haproxy/peers-t.h b/include/haproxy/peers-t.h index 4bff874bb..90c3a4fd7 100644 --- a/include/haproxy/peers-t.h +++ b/include/haproxy/peers-t.h @@ -34,6 +34,11 @@ #include #include +#define PEER_MSG_HEADER_LEN 2 + +/* The maximum length of an encoded data length. */ +#define PEER_MSG_ENC_LENGTH_MAXLEN 5 + /* peer state with respects of its applet, as seen from outside */ enum peer_app_state { PEER_APP_ST_STOPPED = 0, /* The peer has no applet */ diff --git a/src/peers.c b/src/peers.c index 04996e4a1..3a4a1de21 100644 --- a/src/peers.c +++ b/src/peers.c @@ -185,9 +185,6 @@ struct peer_prep_params { #define PEER_MSG_STKT_BIT 7 #define PEER_MSG_STKT_BIT_MASK (1 << PEER_MSG_STKT_BIT) -/* The maximum length of an encoded data length. */ -#define PEER_MSG_ENC_LENGTH_MAXLEN 5 - /* Minimum 64-bits value encoded with 2 bytes */ #define PEER_ENC_2BYTES_MIN 0xf0 /* 0xf0 (or 240) */ /* 3 bytes */ @@ -214,8 +211,6 @@ struct peer_prep_params { /* The left most number of bits set for PEER_ENC_2BYTES_MIN */ #define PEER_ENC_2BYTES_MIN_BITS 4 -#define PEER_MSG_HEADER_LEN 2 - #define PEER_STKT_CACHE_MAX_ENTRIES 128 /**********************************/