+- Fixed temporary stuf with conf_link

This commit is contained in:
stskeeps 2001-02-14 11:34:11 +00:00
parent a3d4c1af6e
commit e0588102ac
3 changed files with 23 additions and 8 deletions

View file

@ -200,3 +200,4 @@
- Made /rehash work .. sortof. Fixed some crash bugs
- Added /stats P on listener info (oper-only)
- listener temporary stuff works now
- Fixed temporary stuf with conf_link

View file

@ -1957,6 +1957,19 @@ void run_configuration(void)
}
}
void link_cleanup(ConfigItem_link *link_ptr)
{
ircfree(link_ptr->servername);
ircfree(link_ptr->username);
ircfree(link_ptr->bindip);
ircfree(link_ptr->hostname);
ircfree(link_ptr->hubmask);
ircfree(link_ptr->leafmask);
ircfree(link_ptr->connpwd);
ircfree(link_ptr->recvpwd);
}
void listen_cleanup()
{
int i = 0;
@ -2072,14 +2085,7 @@ int rehash(cptr, sptr, sig)
{
if (link_ptr->refcount == 0)
{
ircfree(link_ptr->servername);
ircfree(link_ptr->username);
ircfree(link_ptr->bindip);
ircfree(link_ptr->hostname);
ircfree(link_ptr->hubmask);
ircfree(link_ptr->leafmask);
ircfree(link_ptr->connpwd);
ircfree(link_ptr->recvpwd);
link_cleanup(link_ptr);
t.next = del_ConfigItem((ConfigItem *) link_ptr, (ConfigItem **)&conf_link);
MyFree(link_ptr);
link_ptr = (ConfigItem_link *) &t;

View file

@ -449,6 +449,14 @@ int exit_client(cptr, sptr, from, comment)
{
IRCstats.me_servers--;
sptr->serv->conf->refcount--;
if (!sptr->serv->conf->refcount
&& sptr->serv->conf->flag.temporary)
{
/* Due for deletion */
del_ConfigItem((ConfigItem *) sptr->serv->conf, (ConfigItem **)&conf_link);
link_cleanup(sptr->serv->conf);
MyFree(sptr->serv->conf);
}
}
if (sptr->listener)