Merge branch 'master' into release/4
This commit is contained in:
commit
74edf6bac0
4 changed files with 22 additions and 5 deletions
|
@ -615,7 +615,7 @@ add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_lis
|
||||||
stats->host = rb_strdup(host);
|
stats->host = rb_strdup(host);
|
||||||
stats->iptype = iptype;
|
stats->iptype = iptype;
|
||||||
stats->hits = 0;
|
stats->hits = 0;
|
||||||
rb_dictionary_add(bl_stats, host, stats);
|
rb_dictionary_add(bl_stats, stats->host, stats);
|
||||||
|
|
||||||
rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", host, iptype, filterbuf, reason);
|
rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", host, iptype, filterbuf, reason);
|
||||||
}
|
}
|
||||||
|
@ -627,9 +627,9 @@ del_blacklist(const char *host)
|
||||||
struct BlacklistStats *stats = rb_dictionary_retrieve(bl_stats, host);
|
struct BlacklistStats *stats = rb_dictionary_retrieve(bl_stats, host);
|
||||||
if(stats != NULL)
|
if(stats != NULL)
|
||||||
{
|
{
|
||||||
|
rb_dictionary_delete(bl_stats, host);
|
||||||
rb_free(stats->host);
|
rb_free(stats->host);
|
||||||
rb_free(stats);
|
rb_free(stats);
|
||||||
rb_dictionary_delete(bl_stats, host);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_helper_write(authd_helper, "O rbl_del %s", host);
|
rb_helper_write(authd_helper, "O rbl_del %s", host);
|
||||||
|
|
|
@ -71,7 +71,7 @@ capability_put(struct CapabilityIndex *idx, const char *cap, void *ownerdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = rb_malloc(sizeof(struct CapabilityEntry));
|
entry = rb_malloc(sizeof(struct CapabilityEntry));
|
||||||
entry->cap = cap;
|
entry->cap = rb_strdup(cap);
|
||||||
entry->flags = 0;
|
entry->flags = 0;
|
||||||
entry->value = idx->highest_bit;
|
entry->value = idx->highest_bit;
|
||||||
entry->ownerdata = ownerdata;
|
entry->ownerdata = ownerdata;
|
||||||
|
@ -133,7 +133,9 @@ capability_destroy(rb_dictionary_element *delem, void *privdata)
|
||||||
{
|
{
|
||||||
s_assert(delem != NULL);
|
s_assert(delem != NULL);
|
||||||
|
|
||||||
rb_free(delem->data);
|
struct CapabilityEntry *entry = delem->data;
|
||||||
|
rb_free((char *)entry->cap);
|
||||||
|
rb_free(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CapabilityIndex *
|
struct CapabilityIndex *
|
||||||
|
|
|
@ -294,6 +294,9 @@ unload_one_module(const char *name, bool warn)
|
||||||
if((mod = findmodule_byname(name)) == NULL)
|
if((mod = findmodule_byname(name)) == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if(mod->core)
|
||||||
|
return false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** XXX - The type system in C does not allow direct conversion between
|
** XXX - The type system in C does not allow direct conversion between
|
||||||
** data and function pointers, but as it happens, most C compilers will
|
** data and function pointers, but as it happens, most C compilers will
|
||||||
|
|
|
@ -349,7 +349,19 @@ do_modrestart(struct Client *source_p)
|
||||||
RB_DLINK_FOREACH_SAFE(ptr, nptr, module_list.head)
|
RB_DLINK_FOREACH_SAFE(ptr, nptr, module_list.head)
|
||||||
{
|
{
|
||||||
struct module *mod = ptr->data;
|
struct module *mod = ptr->data;
|
||||||
unload_one_module(mod->name, false);
|
if(!unload_one_module(mod->name, false))
|
||||||
|
{
|
||||||
|
ilog(L_MAIN, "Module Restart: %s was not unloaded %s",
|
||||||
|
mod->name,
|
||||||
|
mod->core? "(core module)" : "");
|
||||||
|
|
||||||
|
if(!mod->core)
|
||||||
|
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
|
||||||
|
"Module Restart: %s failed to unload",
|
||||||
|
mod->name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
modnum++;
|
modnum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue