Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv19470/src
Modified Files:
proto-p10.c
Log Message:
fix burst (to follow uplink, and send our leftover channels after uplink's EOB)
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** proto-p10.c 9 Sep 2002 19:13:52 -0000 1.31
--- proto-p10.c 12 Sep 2002 01:26:48 -0000 1.32
***************
*** 283,290 ****
static privmsg_func_t *notice_funcs;
static unsigned int num_notice_funcs;
! static dict_iterator_t chan_burst_iter;
static struct userNode *AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip);
- static void send_channels(struct chanNode *last);
/* Numerics can be XYY, XYYY, or XXYYY; with X's identifying the
--- 283,289 ----
static privmsg_func_t *notice_funcs;
static unsigned int num_notice_funcs;
! static struct dict *unbursted_channels;
static struct userNode *AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip);
/* Numerics can be XYY, XYYY, or XXYYY; with X's identifying the
***************
*** 586,598 ****
}
- static void
- send_channels(struct chanNode *last) {
- for (;
- chan_burst_iter && (!last || (irccasecmp(iter_key(chan_burst_iter), last->name) <= 0));
- chan_burst_iter = iter_next(chan_burst_iter)) {
- irc_burst(iter_data(chan_burst_iter));
- }
- }
-
void
irc_quit(struct userNode *user, const char *message)
--- 585,588 ----
***************
*** 745,749 ****
srv = self->uplink = AddServer(self, argv[1], atoi(argv[2]), atoi(argv[3]), atoi(argv[4]), argv[6], argv[argc-1]);
if (!srv) return 0;
- chan_burst_iter = dict_first(channels);
srv->self_burst = argv[5][0] == 'J';
srv->burst = 1;
--- 735,738 ----
***************
*** 784,787 ****
--- 773,777 ----
{
struct server *sender;
+ dict_iterator_t it;
(void)argc; (void)argv; /* we don't care about these */
***************
*** 789,793 ****
if (sender == self->uplink) {
cManager.uplink->state = CONNECTED;
! send_channels(NULL);
irc_eob();
irc_eob_ack();
--- 779,787 ----
if (sender == self->uplink) {
cManager.uplink->state = CONNECTED;
! for (it = dict_first(unbursted_channels); it; it = iter_next(it)) {
! irc_burst(iter_data(it));
! }
! dict_delete(unbursted_channels);
! unbursted_channels = NULL;
irc_eob();
irc_eob_ack();
***************
*** 966,970 ****
if (self->burst && (cNode = GetChannel(argv[1]))) {
cNode->timestamp = atoi(argv[2]);
! send_channels(cNode);
}
cNode = AddChannel(argv[1], (time_t)atoi(argv[2]), modes, key, limit, banlist);
--- 960,965 ----
if (self->burst && (cNode = GetChannel(argv[1]))) {
cNode->timestamp = atoi(argv[2]);
! dict_remove(unbursted_channels, cNode->name);
! irc_burst(cNode);
}
cNode = AddChannel(argv[1], (time_t)atoi(argv[2]), modes, key, limit, banlist);
***************
*** 2305,2308 ****
--- 2300,2304 ----
{
unsigned int i, hop, max_hop=1;
+ dict_iterator_t it;
/* burst (juped) servers, closest first (except self, which is sent already) */
***************
*** 2324,2327 ****
--- 2320,2329 ----
for (i=0; i<=self->num_mask; i++) {
if (self->users[i]) irc_user(self->users[i]);
+ }
+
+ /* build dict of unbursted channel names (just copy existing channels) */
+ unbursted_channels = dict_new();
+ for (it = dict_first(channels); it; it = iter_next(it)) {
+ dict_insert(unbursted_channels, iter_key(it), iter_data(it));
}
}
|