Created
August 21, 2015 11:12
-
-
Save NickCraver/e9b8ccc674be0c102c5e to your computer and use it in GitHub Desktop.
MASTER MODE enabled (user request from '<client>') redis patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/replication.c b/src/replication.c | |
index 8102fc2..d9545b8 100644 | |
--- a/src/replication.c | |
+++ b/src/replication.c | |
@@ -1250,8 +1250,10 @@ void slaveofCommand(redisClient *c) { | |
if (!strcasecmp(c->argv[1]->ptr,"no") && | |
!strcasecmp(c->argv[2]->ptr,"one")) { | |
if (server.masterhost) { | |
+ sds client = getClientInfoString(c); | |
replicationUnsetMaster(); | |
- redisLog(REDIS_NOTICE,"MASTER MODE enabled (user request)"); | |
+ redisLog(REDIS_NOTICE,"MASTER MODE enabled (user request | |
from '%s')", cli | |
+ sdsfree(client); | |
} | |
} else { | |
long port; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment