/[svn]/ircd-hybrid/trunk/src/irc_res.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/src/irc_res.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1653 by michael, Sat Oct 27 21:02:32 2012 UTC revision 1654 by michael, Fri Nov 16 19:39:37 2012 UTC
# Line 21  Line 21 
21    
22  #include "stdinc.h"  #include "stdinc.h"
23  #include "list.h"  #include "list.h"
 #include "balloc.h"  
24  #include "client.h"  #include "client.h"
25  #include "event.h"  #include "event.h"
26  #include "irc_string.h"  #include "irc_string.h"
# Line 35  Line 34 
34  #include "s_misc.h"  #include "s_misc.h"
35  #include "send.h"  #include "send.h"
36  #include "memory.h"  #include "memory.h"
37    #include "mempool.h"
38  #include "irc_res.h"  #include "irc_res.h"
39  #include "irc_reslib.h"  #include "irc_reslib.h"
40    
# Line 91  struct reslist Line 91  struct reslist
91    
92  static fde_t ResolverFileDescriptor;  static fde_t ResolverFileDescriptor;
93  static dlink_list request_list = { NULL, NULL, 0 };  static dlink_list request_list = { NULL, NULL, 0 };
94  static BlockHeap *dns_heap = NULL;  static mp_pool_t *dns_pool = NULL;
95    
96  static void rem_request(struct reslist *);  static void rem_request(struct reslist *);
97  static struct reslist *make_request(dns_callback_fnc, void *);  static struct reslist *make_request(dns_callback_fnc, void *);
# Line 244  start_resolver(void) Line 244  start_resolver(void)
244  void  void
245  init_resolver(void)  init_resolver(void)
246  {  {
247    dns_heap = BlockHeapCreate("dns", sizeof(struct reslist), DNS_HEAP_SIZE);    dns_pool = mp_pool_new(sizeof(struct reslist), MP_CHUNK_SIZE_DNS);
248    memset(&ResolverFileDescriptor, 0, sizeof(fde_t));    memset(&ResolverFileDescriptor, 0, sizeof(fde_t));
249    start_resolver();    start_resolver();
250  }  }
# Line 271  rem_request(struct reslist *request) Line 271  rem_request(struct reslist *request)
271    dlinkDelete(&request->node, &request_list);    dlinkDelete(&request->node, &request_list);
272    
273    MyFree(request->name);    MyFree(request->name);
274    BlockHeapFree(dns_heap, request);    mp_pool_release(request);
275  }  }
276    
277  /*  /*
# Line 280  rem_request(struct reslist *request) Line 280  rem_request(struct reslist *request)
280  static struct reslist *  static struct reslist *
281  make_request(dns_callback_fnc callback, void *ctx)  make_request(dns_callback_fnc callback, void *ctx)
282  {  {
283    struct reslist *request = BlockHeapAlloc(dns_heap);    struct reslist *request = mp_pool_get(dns_pool);
284    
285      memset(request, 0, sizeof(*request));
286    request->sentat       = CurrentTime;    request->sentat       = CurrentTime;
287    request->retries      = 3;    request->retries      = 3;
288    request->resend       = 1;    request->resend       = 1;

Legend:
Removed from v.1653  
changed lines
  Added in v.1654

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28