Commit 6e9864fe authored by artix's avatar artix
Browse files

Cluster Manager: fix bus error in clusterManagerGetLinkStatus

parent 121adc60
...@@ -1994,6 +1994,15 @@ static dictType clusterManagerDictType = { ...@@ -1994,6 +1994,15 @@ static dictType clusterManagerDictType = {
dictSdsDestructor /* val destructor */ dictSdsDestructor /* val destructor */
}; };
static dictType clusterManagerLinkDictType = {
dictSdsHash, /* hash function */
NULL, /* key dup */
NULL, /* val dup */
dictSdsKeyCompare, /* key compare */
dictSdsDestructor, /* key destructor */
dictListDestructor /* val destructor */
};
typedef int clusterManagerCommandProc(int argc, char **argv); typedef int clusterManagerCommandProc(int argc, char **argv);
typedef int (*clusterManagerOnReplyError)(redisReply *reply, typedef int (*clusterManagerOnReplyError)(redisReply *reply,
clusterManagerNode *n, int bulk_idx); clusterManagerNode *n, int bulk_idx);
...@@ -3907,10 +3916,7 @@ cleanup: ...@@ -3907,10 +3916,7 @@ cleanup:
* node addresses that cannot reach the unreachable node. */ * node addresses that cannot reach the unreachable node. */
static dict *clusterManagerGetLinkStatus(void) { static dict *clusterManagerGetLinkStatus(void) {
if (cluster_manager.nodes == NULL) return NULL; if (cluster_manager.nodes == NULL) return NULL;
dictType dtype = clusterManagerDictType; dict *status = dictCreate(&clusterManagerLinkDictType, NULL);
dtype.keyDestructor = dictSdsDestructor;
dtype.valDestructor = dictListDestructor;
dict *status = dictCreate(&dtype, NULL);
listIter li; listIter li;
listNode *ln; listNode *ln;
listRewind(cluster_manager.nodes, &li); listRewind(cluster_manager.nodes, &li);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment