1
0
forked from bip/bip

QUIT message when quitting

This commit is contained in:
nohar 2005-05-27 16:50:26 +00:00
parent 14cf13cfb6
commit 822f720e0e
2 changed files with 18 additions and 0 deletions

View File

@ -266,8 +266,21 @@ void reload_config(int i)
sighup = 1;
}
extern list_t *_connections;
void bad_quit(int i)
{
list_iterator_t it;
for (list_it_init(_connections, &it); list_it_item(&it);
list_it_next(&it)) {
connection_t *c = list_it_item(&it);
struct link_any *la = c->user_data;
if (c->connected == CONN_OK && la &&
TYPE(la) == IRC_TYPE_SERVER) {
write_line_fast(CONN(la), "QUIT :Coyote finally "
"caught me\r\n");
}
}
unlink(conf_pid_file);
exit(i);
}

View File

@ -1877,6 +1877,8 @@ void oidentd_dump(list_t *connl)
}
#endif
/* do not use */
list_t *_connections = NULL;
struct link_client *reloading_client;
/*
@ -1900,6 +1902,8 @@ void irc_main(connection_t *inc, list_t *ll)
list_init(&connecting_c, list_ptr_cmp);
list_init(&connected_c, list_ptr_cmp);
_connections = &connl;
/* XXX: This one MUST be first */
list_add_first(&connl, inc);
@ -2113,6 +2117,7 @@ prot_err:
;
while (list_remove_first(&reconnectl))
;
_connections = NULL;
return;
}