mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05: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…
Reference in New Issue
Block a user