ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf.c (file contents):
Revision 1653 by michael, Wed Nov 14 11:50:55 2012 UTC vs.
Revision 1654 by michael, Fri Nov 16 19:39:37 2012 UTC

# Line 25 | Line 25
25   #include "stdinc.h"
26   #include "list.h"
27   #include "ircd_defs.h"
28 #include "balloc.h"
28   #include "conf.h"
29   #include "s_serv.h"
30   #include "resv.h"
# Line 45 | Line 44
44   #include "send.h"
45   #include "s_gline.h"
46   #include "memory.h"
47 + #include "mempool.h"
48   #include "irc_res.h"
49   #include "userhost.h"
50   #include "s_user.h"
# Line 104 | Line 104 | struct ip_entry
104   };
105  
106   static struct ip_entry *ip_hash_table[IP_HASH_SIZE];
107 < static BlockHeap *ip_entry_heap = NULL;
107 > static mp_pool_t *ip_entry_pool = NULL;
108   static int ip_entries_count = 0;
109  
110  
# Line 654 | Line 654 | attach_iline(struct Client *client_p, st
654   void
655   init_ip_hash_table(void)
656   {
657 <  ip_entry_heap = BlockHeapCreate("ip", sizeof(struct ip_entry),
657 >  ip_entry_pool = mp_pool_new(sizeof(struct ip_entry),
658      2 * hard_fdlimit);
659    memset(ip_hash_table, 0, sizeof(ip_hash_table));
660   }
# Line 704 | Line 704 | find_or_add_ip(struct irc_ssaddr *ip_in)
704    if (ip_entries_count >= 2 * hard_fdlimit)
705      garbage_collect_ip_entries();
706  
707 <  newptr = BlockHeapAlloc(ip_entry_heap);
707 >  newptr = mp_pool_get(ip_entry_pool);
708 >  memset(newptr, 0, sizeof(*newptr));
709    ip_entries_count++;
710    memcpy(&newptr->ip, ip_in, sizeof(struct irc_ssaddr));
711  
# Line 762 | Line 763 | remove_one_ip(struct irc_ssaddr *ip_in)
763        else
764          ip_hash_table[hash_index] = ptr->next;
765  
766 <      BlockHeapFree(ip_entry_heap, ptr);
766 >      mp_pool_release(ptr);
767        ip_entries_count--;
768        return;
769      }
# Line 865 | Line 866 | garbage_collect_ip_entries(void)
866            last_ptr->next = ptr->next;
867          else
868            ip_hash_table[i] = ptr->next;
869 <        BlockHeapFree(ip_entry_heap, ptr);
869 >        mp_pool_release(ptr);
870          ip_entries_count--;
871        }
872        else
# Line 1077 | Line 1078 | find_matching_name_conf(enum maskitem_ty
1078        DLINK_FOREACH(ptr, list_p->head)
1079        {
1080          conf = ptr->data;
1081 <        assert(conf->regexpname);
1081 >        assert(conf->regexuser);
1082  
1083          if (!ircd_pcre_exec(conf->regexuser, name))
1084            return conf;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)