source_p->name, IsGotId(source_p) ? "" : "~",
source_p->username, source_p->sockhost,
source_p->localClient->listener->name, port);
- add_reject(client_p, NULL, NULL);
- exit_client(client_p, source_p, &me,
- "You are not authorised to use this server");
+ add_reject(client_p, NULL, NULL, NULL, "You are not authorised to use this server.");
+ exit_client(client_p, source_p, &me, "You are not authorised to use this server.");
break;
}
case BANNED_CLIENT:
form_str(ERR_YOUREBANNEDCREEP),
me.name, client_p->name,
get_user_ban_reason(aconf));
- add_reject(client_p, aconf->user, aconf->host);
+ add_reject(client_p, aconf->user, aconf->host, aconf, NULL);
return (BANNED_CLIENT);
}
return (attach_conf(client_p, aconf));
}
+/*
+ * deref_conf
+ *
+ * inputs - ConfItem that is referenced by something other than a client
+ * side effects - Decrement and free ConfItem if appropriate
+ */
+void
+deref_conf(struct ConfItem *aconf)
+{
+ aconf->clients--;
+ if(!aconf->clients && IsIllegal(aconf))
+ free_conf(aconf);
+}
+
/*
* detach_conf
*
break;
}
if (aconf->lifetime != 0 && now < aconf->lifetime)
+ {
aconf->status |= CONF_ILLEGAL;
+ }
else
{
if (aconf->lifetime != 0)
rb_dlinkDestroy(ptr, &prop_bans);
- free_conf(aconf);
+ if (aconf->clients == 0)
+ free_conf(aconf);
+ else
+ aconf->status |= CONF_ILLEGAL;
}
}