mirror of
https://github.com/fluencelabs/redis
synced 2025-03-25 20:01:04 +00:00
Make sure replicationSetMaster() works when ip argument is not an sds.
This commit is contained in:
parent
b8a28bf442
commit
3be893123f
@ -1229,7 +1229,7 @@ int cancelReplicationHandshake(void) {
|
|||||||
/* Set replication to the specified master address and port. */
|
/* Set replication to the specified master address and port. */
|
||||||
void replicationSetMaster(char *ip, int port) {
|
void replicationSetMaster(char *ip, int port) {
|
||||||
sdsfree(server.masterhost);
|
sdsfree(server.masterhost);
|
||||||
server.masterhost = sdsdup(ip);
|
server.masterhost = sdsnew(ip);
|
||||||
server.masterport = port;
|
server.masterport = port;
|
||||||
if (server.master) freeClient(server.master);
|
if (server.master) freeClient(server.master);
|
||||||
disconnectSlaves(); /* Force our slaves to resync with us as well. */
|
disconnectSlaves(); /* Force our slaves to resync with us as well. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user