summaryrefslogtreecommitdiff
path: root/src/cluster.h
diff options
context:
space:
mode:
authorPing Xie <11568491+PingXie@users.noreply.github.com>2022-02-16 13:35:49 -0800
committerGitHub <noreply@github.com>2022-02-16 13:35:49 -0800
commitf7f68c654a90c4d3e84121c4555a56682b02b2de (patch)
tree75d49c2360fc917b6d4b46957a608947ddc4dff1 /src/cluster.h
parentcca3577503037117f497085d7994af944c0379e5 (diff)
downloadredis-f7f68c654a90c4d3e84121c4555a56682b02b2de.tar.gz
Use sds for clusterNode.hostname (#10290)
* Provide a fallback static_assert implementation * Use sds for clusterNode.hostname
Diffstat (limited to 'src/cluster.h')
-rw-r--r--src/cluster.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cluster.h b/src/cluster.h
index 465654205..7e0d7c25a 100644
--- a/src/cluster.h
+++ b/src/cluster.h
@@ -134,8 +134,8 @@ typedef struct clusterNode {
mstime_t repl_offset_time; /* Unix time we received offset for this node */
mstime_t orphaned_time; /* Starting time of orphaned master condition */
long long repl_offset; /* Last known repl offset for this node. */
- char ip[NET_IP_STR_LEN]; /* Latest known IP address of this node */
- char *hostname; /* The known hostname for this node */
+ char ip[NET_IP_STR_LEN]; /* Latest known IP address of this node */
+ sds hostname; /* The known hostname for this node */
int port; /* Latest known clients port (TLS or plain). */
int pport; /* Latest known clients plaintext port. Only used
if the main clients port is for TLS. */
@@ -339,8 +339,6 @@ typedef struct {
* changes in clusterMsg be caught at compile time.
*/
-/* Avoid static_assert on non-C11 compilers. */
-#if __STDC_VERSION__ >= 201112L
static_assert(offsetof(clusterMsg, sig) == 0, "unexpected field offset");
static_assert(offsetof(clusterMsg, totlen) == 4, "unexpected field offset");
static_assert(offsetof(clusterMsg, ver) == 8, "unexpected field offset");
@@ -362,7 +360,6 @@ static_assert(offsetof(clusterMsg, flags) == 2250, "unexpected field offset");
static_assert(offsetof(clusterMsg, state) == 2252, "unexpected field offset");
static_assert(offsetof(clusterMsg, mflags) == 2253, "unexpected field offset");
static_assert(offsetof(clusterMsg, data) == 2256, "unexpected field offset");
-#endif
#define CLUSTERMSG_MIN_LEN (sizeof(clusterMsg)-sizeof(union clusterMsgData))