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-03-14 18:01:08 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-03-14 18:01:08 +0000
commitdcfcd9302fe67bfe1aeb67db4203867d173d3073 (patch)
tree8220b8762f7eeedad32da4325be023a1fafd9c54 /src
parent8c95c8f4904d3c1fd5e173f1d52356c921faf83d (diff)
BUILD : 1.7.8 (619) BUGS : NOTES : Fixed the recording of server sync state more reliable, which fixes a bug where servers which did not report bursts would always remain in burst-mode internally
git-svn-id: svn://svn.anope.org/anope/trunk@619 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@467 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/bahamut.c7
-rw-r--r--src/channels.c4
-rw-r--r--src/dreamforge.c1
-rw-r--r--src/hybrid.c7
-rw-r--r--src/plexus.c7
-rw-r--r--src/ptlink.c1
-rw-r--r--src/rageircd.c7
-rw-r--r--src/ratbox.c1
-rw-r--r--src/servers.c39
-rw-r--r--src/shadowircd.c7
-rw-r--r--src/solidircd.c7
-rw-r--r--src/ultimate2.c1
-rw-r--r--src/ultimate3.c18
-rw-r--r--src/unreal31.c1
-rw-r--r--src/unreal32.c7
-rw-r--r--src/viagra.c7
16 files changed, 81 insertions, 41 deletions
diff --git a/src/bahamut.c b/src/bahamut.c
index b988ff858..793801343 100644
--- a/src/bahamut.c
+++ b/src/bahamut.c
@@ -112,6 +112,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
}
,
{NULL}
@@ -1614,9 +1615,9 @@ int anope_event_burst(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
}
return MOD_CONT;
}
diff --git a/src/channels.c b/src/channels.c
index 654e1681a..529073ec2 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -1281,7 +1281,7 @@ void chan_adduser2(User * user, Channel * c)
}
/* Added channelname to entrymsg - 30.03.2004, Certus */
/* Also, don't send the entrymsg when bursting -GD */
- if (c->ci && c->ci->entry_message && (me_server->sync == 1))
+ if (c->ci && c->ci->entry_message && is_sync(user->server))
notice_user(whosends(c->ci), user, "[%s] %s", c->name,
c->ci->entry_message);
}
@@ -1302,7 +1302,7 @@ void chan_adduser2(User * user, Channel * c)
* to has synced, or we'll get greet-floods when the net
* recovers from a netsplit. -GD
*/
- if (me_server->sync == 1) {
+ if (is_sync(user->server) == 1) {
anope_cmd_privmsg(c->ci->bi->nick, c->name, "[%s] %s",
user->na->nick, user->na->nc->greet);
c->ci->bi->lastmsg = time(NULL);
diff --git a/src/dreamforge.c b/src/dreamforge.c
index 399f3c765..2165035c2 100644
--- a/src/dreamforge.c
+++ b/src/dreamforge.c
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 0, /* reports sync state */
}
,
{NULL}
diff --git a/src/hybrid.c b/src/hybrid.c
index b81874282..2fa6315ca 100644
--- a/src/hybrid.c
+++ b/src/hybrid.c
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
0, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
}
,
{NULL}
@@ -931,9 +932,9 @@ int anope_event_eob(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
return MOD_CONT;
}
diff --git a/src/plexus.c b/src/plexus.c
index 83684f0ac..e15348815 100644
--- a/src/plexus.c
+++ b/src/plexus.c
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
0, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
}
,
{NULL}
@@ -1013,9 +1014,9 @@ int anope_event_eob(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
return MOD_CONT;
}
diff --git a/src/ptlink.c b/src/ptlink.c
index 753ca2db9..a91a1271e 100644
--- a/src/ptlink.c
+++ b/src/ptlink.c
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 0, /* reports sync state */
}
,
{NULL}
diff --git a/src/rageircd.c b/src/rageircd.c
index ea7719bb2..c8a4019d6 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -111,6 +111,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
},
{NULL}
};
@@ -591,9 +592,9 @@ int anope_event_burst(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
}
return MOD_CONT;
}
diff --git a/src/ratbox.c b/src/ratbox.c
index 38ea060b2..d0b5ef3e8 100644
--- a/src/ratbox.c
+++ b/src/ratbox.c
@@ -112,6 +112,7 @@ IRCDVar ircd[] = {
0, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 0, /* reports sync state */
}
,
{NULL}
diff --git a/src/servers.c b/src/servers.c
index 211d27fce..e5579bca0 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -15,7 +15,8 @@
#include "services.h"
Server *servlist = NULL;
-Server *me_server = NULL; /* Our uplink server */
+Server *me_server = NULL; /* This are we */
+Server *serv_uplink = NULL; /* This is our uplink */
uint32 uplink_capab;
char *uplink;
char *TS6UPLINK;
@@ -103,7 +104,10 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
} else {
serv->suid = NULL;
}
- serv->sync = -1;
+ if (ircd->sync)
+ serv->sync = SSYNC_IN_PROGRESS;
+ else
+ serv->sync = SSYNC_UNKNOWN;
serv->links = NULL;
serv->prev = NULL;
@@ -120,6 +124,9 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
uplink->links->prev = serv;
uplink->links = serv;
}
+ /* Check if this is our uplink server */
+ if ((uplink == me_server) && !(flags & SERVER_JUPED))
+ serv_uplink = serv;
return serv;
}
@@ -289,14 +296,13 @@ int anope_check_sync(const char *name)
Server *s;
s = findserver(servlist, name);
- if (!s) {
- return 0;
- }
- if (s->sync) {
- return s->sync;
- } else {
+ if (!s)
return 0;
- }
+
+ if (is_sync(s))
+ return 1;
+ else
+ return -1;
}
/*************************************************************************/
@@ -522,4 +528,19 @@ int is_ulined(char *server)
return 0;
}
+/*************************************************************************/
+
+/**
+ * See if the current server is synced, or has an unknown sync state
+ * (in which case we pretend it is always synced)
+ * @param server Server of which we want to know the state
+ * @return int 0 if not synced, 1 if synced
+ */
+int is_sync(Server * server)
+{
+ if ((server->sync == SSYNC_DONE) || (server->sync == SSYNC_UNKNOWN))
+ return 1;
+ return 0;
+}
+
/* EOF */
diff --git a/src/shadowircd.c b/src/shadowircd.c
index 954ca1c20..e97e25c03 100644
--- a/src/shadowircd.c
+++ b/src/shadowircd.c
@@ -113,6 +113,7 @@ IRCDVar ircd[] = {
0, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
}
,
{NULL}
@@ -1145,9 +1146,9 @@ int anope_event_eos(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
return MOD_CONT;
}
diff --git a/src/solidircd.c b/src/solidircd.c
index 92888a1b9..028faf7fc 100644
--- a/src/solidircd.c
+++ b/src/solidircd.c
@@ -112,6 +112,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
}
,
{NULL}
@@ -1651,9 +1652,9 @@ int anope_event_burst(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
}
return MOD_CONT;
}
diff --git a/src/ultimate2.c b/src/ultimate2.c
index ad72972c7..8c24f29bd 100644
--- a/src/ultimate2.c
+++ b/src/ultimate2.c
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 0, /* reports sync state */
}
,
{NULL}
diff --git a/src/ultimate3.c b/src/ultimate3.c
index 75059d339..97fdddb62 100644
--- a/src/ultimate3.c
+++ b/src/ultimate3.c
@@ -112,6 +112,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
},
{NULL}
};
@@ -1744,9 +1745,9 @@ int anope_event_eob(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
}
return MOD_CONT;
}
@@ -1759,9 +1760,14 @@ int anope_event_burst(char *source, int ac, char **av)
if (!ac) {
/* for future use - start burst */
} else {
- if (s) {
- s->sync = 1;
- }
+ /* If we found a server with the given source, that one just
+ * finished bursting. If there was no source, then our uplink
+ * server finished bursting. -GD
+ */
+ if (s)
+ s->sync = SSYNC_DONE;
+ else
+ me_server->sync = SSYNC_DONE;
}
return MOD_CONT;
}
diff --git a/src/unreal31.c b/src/unreal31.c
index cbdc77276..a39c8e4fe 100644
--- a/src/unreal31.c
+++ b/src/unreal31.c
@@ -113,6 +113,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 0, /* reports sync state */
},
{NULL}
};
diff --git a/src/unreal32.c b/src/unreal32.c
index ea2a8e0cc..5699717ca 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -112,6 +112,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
},
{NULL}
};
@@ -1572,9 +1573,9 @@ int anope_event_eos(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
return MOD_CONT;
}
diff --git a/src/viagra.c b/src/viagra.c
index 90e99e8c3..772971ea2 100644
--- a/src/viagra.c
+++ b/src/viagra.c
@@ -111,6 +111,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
+ 1, /* reports sync state */
}
,
{NULL}
@@ -643,9 +644,9 @@ int anope_event_burst(char *source, int ac, char **av)
* server finished bursting. -GD
*/
if (s)
- s->sync = 1;
- else
- me_server->sync = 1;
+ s->sync = SSYNC_DONE;
+ else if (serv_uplink)
+ serv_uplink->sync = SSYNC_DONE;
}
return MOD_CONT;
}