summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-04-04 14:16:25 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-04-04 14:16:25 +0000
commitd31359dcdc37be9797e50cdf1a6850c1f5ef0119 (patch)
tree6bb0449df10a73d77b1200d824024a4cd4560547 /src
parentb738b7d6bc550ebdfb2e5b7068afa54dc6e1f9f7 (diff)
BUILD : 1.7.8 (655) BUGS : NOTES : We need to update the sync-state for leaf servers as well, or strange things will happen...
git-svn-id: svn://svn.anope.org/anope/trunk@655 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@503 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/bahamut.c8
-rw-r--r--src/hybrid.c8
-rw-r--r--src/plexus.c8
-rw-r--r--src/rageircd.c8
-rw-r--r--src/servers.c50
-rw-r--r--src/shadowircd.c8
-rw-r--r--src/solidircd.c8
-rw-r--r--src/ultimate3.c8
-rw-r--r--src/unreal32.c8
-rw-r--r--src/viagra.c8
10 files changed, 77 insertions, 45 deletions
diff --git a/src/bahamut.c b/src/bahamut.c
index dca254bff..1f54406bc 100644
--- a/src/bahamut.c
+++ b/src/bahamut.c
@@ -1619,11 +1619,9 @@ int anope_event_burst(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
}
return MOD_CONT;
}
diff --git a/src/hybrid.c b/src/hybrid.c
index fb9a87254..b966fa5a7 100644
--- a/src/hybrid.c
+++ b/src/hybrid.c
@@ -933,11 +933,9 @@ int anope_event_eob(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
return MOD_CONT;
}
diff --git a/src/plexus.c b/src/plexus.c
index 7b5c54f2f..63ef88996 100644
--- a/src/plexus.c
+++ b/src/plexus.c
@@ -1015,11 +1015,9 @@ int anope_event_eob(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
return MOD_CONT;
}
diff --git a/src/rageircd.c b/src/rageircd.c
index b638d210c..b357a408c 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -593,11 +593,9 @@ int anope_event_burst(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
}
return MOD_CONT;
}
diff --git a/src/servers.c b/src/servers.c
index eb91f1226..9fb63c734 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -550,4 +550,54 @@ int is_sync(Server * server)
return 0;
}
+/*************************************************************************/
+
+/* Finish the syncing process for this server and (optionally) for all
+ * it's leaves as well
+ * @param serv Server to finish syncing
+ * @param sync_links Should all leaves be synced as well? (1: yes, 0: no)
+ * @return void
+ */
+void finish_sync(Server * serv, int sync_links)
+{
+ Server *s;
+
+ if (!serv || is_sync(serv))
+ return;
+
+ /* Mark each server as in sync */
+ s = serv;
+ do {
+ if (!is_sync(s)) {
+ if (debug)
+ alog("Finishing sync for server %s", s->name);
+
+ s->sync = SSYNC_DONE;
+ }
+
+ if (!sync_links)
+ break;
+
+ if (s->links) {
+ s = s->links;
+ } else if (s->next) {
+ s = s->next;
+ } else {
+ do {
+ s = s->uplink;
+ if (s == serv)
+ s = NULL;
+ if (s == me_server)
+ s = NULL;
+ } while (s && !(s->next));
+ if (s)
+ s = s->next;
+ }
+ } while (s);
+
+ /* Do some general stuff which should only be done once */
+ restore_unsynced_topics();
+ alog("Server %s is done syncing", serv->name);
+}
+
/* EOF */
diff --git a/src/shadowircd.c b/src/shadowircd.c
index 0f7924a3f..2e4dcd239 100644
--- a/src/shadowircd.c
+++ b/src/shadowircd.c
@@ -1176,11 +1176,9 @@ int anope_event_eos(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
return MOD_CONT;
}
diff --git a/src/solidircd.c b/src/solidircd.c
index 3c9567bc7..063b1d9c4 100644
--- a/src/solidircd.c
+++ b/src/solidircd.c
@@ -1653,11 +1653,9 @@ int anope_event_burst(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
}
return MOD_CONT;
}
diff --git a/src/ultimate3.c b/src/ultimate3.c
index 052c9812f..0489ef952 100644
--- a/src/ultimate3.c
+++ b/src/ultimate3.c
@@ -1746,11 +1746,9 @@ int anope_event_eob(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
}
return MOD_CONT;
}
diff --git a/src/unreal32.c b/src/unreal32.c
index a4b3cdf35..13b868f37 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -1574,11 +1574,9 @@ int anope_event_eos(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
return MOD_CONT;
}
diff --git a/src/viagra.c b/src/viagra.c
index bc3878fd2..565508091 100644
--- a/src/viagra.c
+++ b/src/viagra.c
@@ -643,11 +643,9 @@ int anope_event_burst(char *source, int ac, char **av)
* finished bursting. If there was no source, then our uplink
* server finished bursting. -GD
*/
- if (s)
- s->sync = SSYNC_DONE;
- else if (serv_uplink)
- serv_uplink->sync = SSYNC_DONE;
- restore_unsynced_topics();
+ if (!s && serv_uplink)
+ s = serv_uplink;
+ finish_sync(s, 1);
}
return MOD_CONT;
}