summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--include/extern.h2
-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
-rw-r--r--version.log6
13 files changed, 85 insertions, 46 deletions
diff --git a/Changes b/Changes
index 29fb31b26..d9a7ed6ff 100644
--- a/Changes
+++ b/Changes
@@ -10,6 +10,7 @@ Provided by Anope Dev. <dev@anope.org> - 2005
02/13 A Internal Event support, see EVENTS in the doc folder for help [ #00]
02/05 A Support for Unreal 3.2 +I channel mode. [ #00]
02/03 A Merged anope-win32 branch into the main, now Win32 ready. [ #00]
+04/01 F Sync state for leaf-servers not updated correctly. [ #00]
03/30 F ChanServ now sets topic again when channel is re-created. [#339]
03/29 F Changed anoperc script to use kill numerics for compliance. [ #00]
03/28 F Moved where GlobalOnCycleUP is located so it now works. [#336]
diff --git a/include/extern.h b/include/extern.h
index 3dff3dea0..fdfd09d4b 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -833,6 +833,8 @@ E void do_squit(const char *source, int ac, char **av);
E void capab_parse(int ac, char **av);
E int anope_check_sync(const char *name);
+E void finish_sync(Server *serv, int sync_links);
+
/**** sessions.c ****/
E Exception *exceptions;
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;
}
diff --git a/version.log b/version.log
index b21155385..a3dc63675 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="8"
-VERSION_BUILD="654"
+VERSION_BUILD="655"
# $Log$
#
+# BUILD : 1.7.8 (655)
+# BUGS :
+# NOTES : We need to update the sync-state for leaf servers as well, or strange things will happen...
+#
# BUILD : 1.7.8 (654)
# BUGS :
# NOTES : DrSteins Makefile Patches...