Fixed Issue 76 (redis-server crashes when it can't connect to MASTER and client connects to SLAVE)

This commit is contained in:
antirez 2009-10-29 11:30:43 +01:00
parent 1807985baf
commit f72b934d14
2 changed files with 2 additions and 1 deletions

1
TODO
View File

@ -10,6 +10,7 @@ VERSION 1.1 TODO
VERSION 1.2 TODO
* Basic Redis-cluster (at least all the features of the Ruby client distribute implementation + ability to set every key in M nodes).
* Append mode log
* Hashes (HSET, HGET, HEXISTS, HLEN, ...).
* An utility able to export an .rdb file into a text-only JSON dump, we can't live anymore without such a tool. Probably an extension to redis-cli.

View File

@ -4648,7 +4648,7 @@ static void infoCommand(redisClient *c) {
server.masterport,
(server.replstate == REDIS_REPL_CONNECTED) ?
"up" : "down",
(int)(time(NULL)-server.master->lastinteraction)
server.master ? ((int)(time(NULL)-server.master->lastinteraction)) : -1
);
}
for (j = 0; j < server.dbnum; j++) {