Skip to content

Instantly share code, notes, and snippets.

@NickCraver
Created August 21, 2015 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickCraver/e9b8ccc674be0c102c5e to your computer and use it in GitHub Desktop.
Save NickCraver/e9b8ccc674be0c102c5e to your computer and use it in GitHub Desktop.
MASTER MODE enabled (user request from '<client>') redis patch
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