]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: peers: move message length constants to peers-t.h
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 18 Nov 2026 10:07:49 +0000 (11:07 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 18 Nov 2026 15:33:22 +0000 (16:33 +0100)
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.

include/haproxy/peers-t.h
src/peers.c

index 4bff874bbd891fac06be2c3e669ac22278481745..90c3a4fd7f12569c8566837589250991c7b30687 100644 (file)
 #include <haproxy/stick_table-t.h>
 #include <haproxy/thread-t.h>
 
+#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 */
index 04996e4a16e373befc9cccd4879597681077e62c..3a4a1de21c2bb791d7246758bfdf26bacc4ffe71 100644 (file)
@@ -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
 
 /**********************************/