summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-03-20 10:32:00 +0100
committerantirez <antirez@gmail.com>2013-03-20 10:32:00 +0100
commit026b9483db2dd1f99deb1f4b398f93f7edc0404d (patch)
treeb3b650d5b8765a0e5ad72d0ec410342e329f372c /src
parentd15b027d91f833eddbee47de26fadd9ff6c782ec (diff)
downloadredis-026b9483db2dd1f99deb1f4b398f93f7edc0404d.tar.gz
Cluster: add sender flags in cluster bus messages header.
Sender flags were not propagated for the sender, but only for nodes in the gossip section. This is odd and in the next commits we'll need to get updated flags for the sender node, so this commit adds a new field in the cluster messages header. The message header is the same size as we reused some free space that was marked as 'unused' because of alignment concerns.
Diffstat (limited to 'src')
-rw-r--r--src/cluster.c1
-rw-r--r--src/redis.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 05c17f873..149b9286f 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -1156,6 +1156,7 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
REDIS_CLUSTER_NAMELEN);
}
hdr->port = htons(server.port);
+ hdr->flags = htons(server.cluster->myself->flags);
hdr->state = server.cluster->state;
memset(hdr->configdigest,0,32); /* FIXME: set config digest */
diff --git a/src/redis.h b/src/redis.h
index 0eb746759..4408925c2 100644
--- a/src/redis.h
+++ b/src/redis.h
@@ -648,8 +648,9 @@ typedef struct {
char slaveof[REDIS_CLUSTER_NAMELEN];
char configdigest[32];
uint16_t port; /* Sender TCP base port */
+ uint16_t flags; /* Sender node flags */
unsigned char state; /* Cluster state from the POV of the sender */
- unsigned char notused[5]; /* Reserved for future use. For alignment. */
+ unsigned char notused[3]; /* Reserved for future use. For alignment. */
union clusterMsgData data;
} clusterMsg;