git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1511
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
+2005-10-04 Michael Poole <mdpoole@troilus.org>
+ [Based on a patch by Jukka Ollila]
+
+ * include/class.h (find_class): Rename to do_find_class().
+
+ * ircd/class.c (class_delete_marked): Keep invalid classes in list
+ until next rehash.
+ (add_class): Use new parameter to do_find_class() to allow a class
+ to be "resurrected".
+ (find_class): Rename.
+ (report_classes): Use 'y' instead of 'Y' when reporting invalid
+ classes.
+
2005-10-01 Michael Poole <mdpoole@troilus.org>
* ircd/m_kick.c (ms_kick): If the kick target is join-delayed,
2005-10-01 Michael Poole <mdpoole@troilus.org>
* ircd/m_kick.c (ms_kick): If the kick target is join-delayed,
#define ConfLinks(x) ((x)->conn_class->ref_count)
/** Get default usermode for ConfItem \a x. */
#define ConfUmode(x) ((x)->conn_class->default_umode)
#define ConfLinks(x) ((x)->conn_class->ref_count)
/** Get default usermode for ConfItem \a x. */
#define ConfUmode(x) ((x)->conn_class->default_umode)
+/** Find a valid configuration class by name. */
+#define find_class(name) do_find_class((name), 0)
extern void class_mark_delete(void);
extern void class_delete_marked(void);
extern void class_mark_delete(void);
extern void class_delete_marked(void);
-extern struct ConnectionClass *find_class(const char *name);
+extern struct ConnectionClass *do_find_class(const char *name, int extras);
extern struct ConnectionClass *make_class(void);
extern void free_class(struct ConnectionClass * tmp);
extern char *get_conf_class(const struct ConfItem *aconf);
extern struct ConnectionClass *make_class(void);
extern void free_class(struct ConnectionClass * tmp);
extern char *get_conf_class(const struct ConfItem *aconf);
/*
* unlink marked classes, delete unreferenced ones
*/
/*
* unlink marked classes, delete unreferenced ones
*/
+ if (cl->valid || Links(cl) > 1)
prev = cl;
else
{
prev->next = cl->next;
prev = cl;
else
{
prev->next = cl->next;
- if (0 == --cl->ref_count)
- free_class(cl);
Debug((DEBUG_DEBUG, "Add Class %s: cf: %u pf: %u ml: %u sq: %d",
name, confreq, ping, maxli, sendq));
assert(name != NULL);
Debug((DEBUG_DEBUG, "Add Class %s: cf: %u pf: %u ml: %u sq: %d",
name, confreq, ping, maxli, sendq));
assert(name != NULL);
+ p = do_find_class(name, 1);
if (!p)
p = make_class();
else
if (!p)
p = make_class();
else
/** Find a connection class by name.
* @param[in] name Name of connection class to search for.
/** Find a connection class by name.
* @param[in] name Name of connection class to search for.
+ * @param[in] extras If non-zero, include unreferenced classes.
* @return Pointer to connection class structure (or NULL if none match).
*/
* @return Pointer to connection class structure (or NULL if none match).
*/
-struct ConnectionClass* find_class(const char *name)
+struct ConnectionClass* do_find_class(const char *name, int extras)
{
struct ConnectionClass *cltmp;
for (cltmp = connClassList; cltmp; cltmp = cltmp->next) {
{
struct ConnectionClass *cltmp;
for (cltmp = connClassList; cltmp; cltmp = cltmp->next) {
+ if (!cltmp->valid || !extras)
+ continue;
if (!ircd_strcmp(ConClass(cltmp), name))
return cltmp;
}
if (!ircd_strcmp(ConClass(cltmp), name))
return cltmp;
}
struct ConnectionClass *cltmp;
for (cltmp = connClassList; cltmp; cltmp = cltmp->next)
struct ConnectionClass *cltmp;
for (cltmp = connClassList; cltmp; cltmp = cltmp->next)
- send_reply(sptr, RPL_STATSYLINE, 'Y', ConClass(cltmp), PingFreq(cltmp),
- ConFreq(cltmp), MaxLinks(cltmp), MaxSendq(cltmp),
- Links(cltmp) - 1);
+ send_reply(sptr, RPL_STATSYLINE, (cltmp->valid ? 'Y' : 'y'),
+ ConClass(cltmp), PingFreq(cltmp), ConFreq(cltmp),
+ MaxLinks(cltmp), MaxSendq(cltmp), Links(cltmp) - 1);
}
/** Return maximum SendQ length for a client.
}
/** Return maximum SendQ length for a client.