summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-07-28 14:36:50 +0200
committerantirez <antirez@gmail.com>2015-07-28 14:36:50 +0200
commit278ea9d16b24add67379e569c236c69fecf55bdb (patch)
tree3b690d4680fcf4cfed41b7ec2173e03cbe661640
parent54c71f2d9678881b22577951f4e5b6823d0c193e (diff)
downloadredis-278ea9d16b24add67379e569c236c69fecf55bdb.tar.gz
replicationHandleMasterDisconnection() belongs to replication.c.
-rw-r--r--src/networking.c14
-rw-r--r--src/replication.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/src/networking.c b/src/networking.c
index 576b6df6e..68b36abb5 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -674,20 +674,6 @@ void disconnectSlaves(void) {
}
}
-/* This function is called when the slave lose the connection with the
- * master into an unexpected way. */
-void replicationHandleMasterDisconnection(void) {
- server.master = NULL;
- server.repl_state = REPL_STATE_CONNECT;
- server.repl_down_since = server.unixtime;
- /* We lost connection with our master, force our slaves to resync
- * with us as well to load the new data set.
- *
- * If server.masterhost is NULL the user called SLAVEOF NO ONE so
- * slave resync is not needed. */
- if (server.masterhost != NULL) disconnectSlaves();
-}
-
void freeClient(client *c) {
listNode *ln;
diff --git a/src/replication.c b/src/replication.c
index a32749f65..15ac76d5e 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -1477,6 +1477,20 @@ void replicationUnsetMaster(void) {
server.repl_state = REPL_STATE_NONE;
}
+/* This function is called when the slave lose the connection with the
+ * master into an unexpected way. */
+void replicationHandleMasterDisconnection(void) {
+ server.master = NULL;
+ server.repl_state = REPL_STATE_CONNECT;
+ server.repl_down_since = server.unixtime;
+ /* We lost connection with our master, force our slaves to resync
+ * with us as well to load the new data set.
+ *
+ * If server.masterhost is NULL the user called SLAVEOF NO ONE so
+ * slave resync is not needed. */
+ if (server.masterhost != NULL) disconnectSlaves();
+}
+
void slaveofCommand(client *c) {
/* SLAVEOF is not allowed in cluster mode as replication is automatically
* configured using the current address of the master node. */