]> jfr.im git - solanum.git/blobdiff - src/newconf.c
Make the epoll check work more reliably.
[solanum.git] / src / newconf.c
index 8c1e52b565ca79950b434f79e2d75807c3c744d6..3cd3a54449ce52d017ff8d265be64b80c3324076 100644 (file)
@@ -85,7 +85,7 @@ add_top_conf(const char *name, int (*sfunc) (struct TopConf *),
 
        tc = MyMalloc(sizeof(struct TopConf));
 
-       DupString(tc->tc_name, name);
+       tc->tc_name = name;
        tc->tc_sfunc = sfunc;
        tc->tc_efunc = efunc;
        tc->tc_entries = items;
@@ -153,7 +153,6 @@ remove_top_conf(char *name)
                return -1;
 
        dlinkDestroy(ptr, &conf_items);
-       MyFree(tc->tc_name);
        MyFree(tc);
 
        return 0;
@@ -537,7 +536,7 @@ conf_end_oper(struct TopConf *tc)
                        yy_tmpoper->rsa_pubkey =
                                (RSA *) PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
 
-                       BIO_set_close(file, BIO_CLOSE);
+                       (void)BIO_set_close(file, BIO_CLOSE);
                        BIO_free(file);
 
                        if(yy_tmpoper->rsa_pubkey == NULL)
@@ -1528,14 +1527,6 @@ conf_set_serverhide_links_delay(void *data)
 {
        int val = *(unsigned int *) data;
 
-       if((val > 0) && ConfigServerHide.links_disabled == 1)
-       {
-               eventAddIsh("cache_links", cache_links, NULL, val);
-               ConfigServerHide.links_disabled = 0;
-       }
-       else if(val != ConfigServerHide.links_delay)
-               eventUpdate("cache_links", val);
-
        ConfigServerHide.links_delay = val;
 }
 
@@ -1588,20 +1579,6 @@ conf_set_service_name(void *data)
                target_p->flags |= FLAGS_SERVICE;
 }
 
-static int
-alias_hash(const char *p)
-{
-       int hash_val = 0;
-
-       while (*p)
-       {
-               hash_val += ((int) (*p) & 0xDF);
-               p++;
-       }
-
-       return (hash_val % MAX_MSG_HASH);
-}
-
 static int
 conf_begin_alias(struct TopConf *tc)
 {
@@ -1619,8 +1596,6 @@ conf_begin_alias(struct TopConf *tc)
 static int
 conf_end_alias(struct TopConf *tc)
 {
-       int hashval;
-
        if (yy_alias == NULL)
                return -1;
 
@@ -1642,9 +1617,10 @@ conf_end_alias(struct TopConf *tc)
                return -1;
        }
 
-       hashval = alias_hash(yy_alias->name);
+       if (!alias_dict)
+               alias_dict = irc_dictionary_create(strcasecmp);
 
-       dlinkAddAlloc(yy_alias, &alias_hash_table[hashval]);
+       irc_dictionary_add(alias_dict, yy_alias->name, yy_alias);
 
        return 0;
 }
@@ -1872,7 +1848,7 @@ add_conf_item(const char *topconf, const char *name, int type, void (*func) (voi
 
        cf = MyMalloc(sizeof(struct ConfEntry));
 
-       DupString(cf->cf_name, name);
+       cf->cf_name = name;
        cf->cf_type = type;
        cf->cf_func = func;
        cf->cf_arg = NULL;