1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 00:36:38 +02:00

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
This commit is contained in:
geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b
2005-03-14 18:01:08 +00:00
parent 8c95c8f490
commit dcfcd9302f
21 changed files with 110 additions and 51 deletions
+1
View File
@@ -8,6 +8,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]
03/14 F Sync state of servers was not recorded reliable enough. [ #00]
03/12 F Services setting already set channel modes. [ #00]
03/12 F Not displaying entrymessage/greets on (re-)sync of uplink anymore.[ #00]
03/12 F Sync state for uplink server not being set correctly. [ #00]
+7 -2
View File
@@ -430,16 +430,21 @@ How To Add IRCd Support
84) P10: Is this IRCd a P10-style IRCd? Use 1 for yes, 0 for no.
83) Character Set: Unreal passes the character set during PROTOCTL,
85) Character Set: Unreal passes the character set during PROTOCTL,
the value is stored here. Set this NULL to start.
86) Reports sync: Does the IRCd report when it's in sync (or done bursting,
depending on how you want to say it)? Remember to set
the sync state for servers correctly if it does.
Use 1 for yes, 0 for no.
So we've had this long list. Now there's a second struct to fill. This
struct isn't as long as the previous one though, so we'll handle it quite
quick compared to the previous one.
IRCDCAPAB ircdcap[] = { }
This struct is based oN the CAPAB defines. You should review the CAPAB
This struct is based on the CAPAB defines. You should review the CAPAB
table below to see how this should be done.
Define Table
+2
View File
@@ -808,12 +808,14 @@ E void notice_help(char *source, User *dest, int message, ...);
E Server *servlist;
E Server *me_server;
E Server *serv_uplink;
E uint32 uplink_capab;
E Server *first_server(int flags);
E Server *next_server(int flags);
E int is_ulined(char *server);
E int is_sync(Server *server);
E Server *new_server(Server * uplink, const char *name, const char *desc,
uint16 flags, char *suid);
+14 -7
View File
@@ -335,6 +335,7 @@ struct ircdvars_ {
int supporthelper; /* +h helper umodes */
int p10; /* ircd is P10 */
char *nickchars; /* character set */
int sync; /* reports sync state */
};
struct ircdcapab_ {
@@ -750,17 +751,23 @@ struct csmodeutil_ {
/* Server data */
typedef enum {
SSYNC_UNKNOWN = 0, /* We can't get the sync state */
SSYNC_IN_PROGRESS = 1, /* Sync is currently in progress */
SSYNC_DONE = 2 /* We're in sync */
} SyncState;
struct server_ {
Server *next, *prev;
char *name; /* Server name */
uint16 hops; /* Hops between services and server */
char *desc; /* Server description */
uint16 flags; /* Some info flags, as defined below */
char *suid; /* Server Univeral ID */
int sync; /* Whether is synced or not */
char *name; /* Server name */
uint16 hops; /* Hops between services and server */
char *desc; /* Server description */
uint16 flags; /* Some info flags, as defined below */
char *suid; /* Server Univeral ID */
SyncState sync; /* Server sync state (see above) */
Server *links; /* Linked list head for linked servers */
Server *links; /* Linked list head for linked servers */
Server *uplink; /* Server which pretends to be the uplink */
};
+4 -3
View File
@@ -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;
}
+2 -2
View File
@@ -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);
+1
View File
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
0, /* reports sync state */
}
,
{NULL}
+4 -3
View File
@@ -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;
}
+4 -3
View File
@@ -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;
}
+1
View File
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
0, /* reports sync state */
}
,
{NULL}
+4 -3
View File
@@ -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;
}
+1
View File
@@ -112,6 +112,7 @@ IRCDVar ircd[] = {
0, /* support helper umode */
0, /* p10 */
NULL, /* character set */
0, /* reports sync state */
}
,
{NULL}
+30 -9
View File
@@ -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) {
if (!s)
return 0;
}
if (s->sync) {
return s->sync;
} else {
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 */
+4 -3
View File
@@ -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;
}
+4 -3
View File
@@ -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;
}
+1
View File
@@ -110,6 +110,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
0, /* reports sync state */
}
,
{NULL}
+12 -6
View File
@@ -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;
}
+1
View File
@@ -113,6 +113,7 @@ IRCDVar ircd[] = {
1, /* support helper umode */
0, /* p10 */
NULL, /* character set */
0, /* reports sync state */
},
{NULL}
};
+4 -3
View File
@@ -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;
}
+4 -3
View File
@@ -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;
}
+5 -1
View File
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="8"
VERSION_BUILD="618"
VERSION_BUILD="619"
# $Log$
#
# 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
#
# BUILD : 1.7.8 (618)
# BUGS :
# NOTES : Fixed a small error in my previous commit caused by making a few if/else if easier to read