Commit d275513b authored by antirez's avatar antirez
Browse files

Merge branch '2.4' of github.com:antirez/redis into 2.4

parents 26184760 c924df8c
...@@ -527,12 +527,18 @@ void freeClient(redisClient *c) { ...@@ -527,12 +527,18 @@ void freeClient(redisClient *c) {
* close the connection with all our slaves if we have any, so * close the connection with all our slaves if we have any, so
* when we'll resync with the master the other slaves will sync again * when we'll resync with the master the other slaves will sync again
* with us as well. Note that also when the slave is not connected * with us as well. Note that also when the slave is not connected
* to the master it will keep refusing connections by other slaves. */ * to the master it will keep refusing connections by other slaves.
*
* We do this only if server.masterhost != NULL. If it is NULL this
* means the user called SLAVEOF NO ONE and we are freeing our
* link with the master, so no need to close link with slaves. */
if (server.masterhost != NULL) {
while (listLength(server.slaves)) { while (listLength(server.slaves)) {
ln = listFirst(server.slaves); ln = listFirst(server.slaves);
freeClient((redisClient*)ln->value); freeClient((redisClient*)ln->value);
} }
} }
}
/* Release memory */ /* Release memory */
zfree(c->argv); zfree(c->argv);
freeClientMultiState(c); freeClientMultiState(c);
......
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