From f72b934d1478add5e580e312e93831cbab178a89 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 29 Oct 2009 11:30:43 +0100 Subject: [PATCH] Fixed Issue 76 (redis-server crashes when it can't connect to MASTER and client connects to SLAVE) --- TODO | 1 + redis.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 07703f4c..941e6675 100644 --- a/TODO +++ b/TODO @@ -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. diff --git a/redis.c b/redis.c index 691996e8..16f2e2e7 100644 --- a/redis.c +++ b/redis.c @@ -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++) {