From 1a32d99b28a8d8cd43e1550b2fbe75b4c53b9fc0 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 14 Feb 2013 15:20:02 +0100 Subject: [PATCH] Cluster: move cluster config file out of config state. This makes us able to avoid allocating the cluster state structure if cluster is not enabled, but still we can handle the configuration directive that sets the cluster config filename. --- src/config.c | 4 ++-- src/redis.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/config.c b/src/config.c index 06ed81deb..7e66050c0 100644 --- a/src/config.c +++ b/src/config.c @@ -375,8 +375,8 @@ void loadServerConfigFromString(char *config) { err = "argument must be 'yes' or 'no'"; goto loaderr; } } else if (!strcasecmp(argv[0],"cluster-config-file") && argc == 2) { - zfree(server.cluster->configfile); - server.cluster->configfile = zstrdup(argv[1]); + zfree(server.cluster_configfile); + server.cluster_configfile = zstrdup(argv[1]); } else if (!strcasecmp(argv[0],"lua-time-limit") && argc == 2) { server.lua_time_limit = strtoll(argv[1],NULL,10); } else if (!strcasecmp(argv[0],"slowlog-log-slower-than") && diff --git a/src/redis.h b/src/redis.h index 6ca1bd1ef..b2dcefb76 100644 --- a/src/redis.h +++ b/src/redis.h @@ -560,7 +560,6 @@ struct clusterNode { typedef struct clusterNode clusterNode; typedef struct { - char *configfile; clusterNode *myself; /* This node */ int state; /* REDIS_CLUSTER_OK, REDIS_CLUSTER_FAIL, ... */ int node_timeout;