Changeset c7cb2706c8c9efa28ec98e664f1ba670d7d6e5bb

Show
Ignore:
Timestamp:
12/02/10 19:00:18 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1291316418 +0000
git-parent:

[cb978e5289aaa3d758cf509f555d119da95e82ad]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1291316418 +0000
Message:

debug the abitrary nameserver dns context reaping

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/lua_dns.c

    ra5e761d rc7cb270  
    9191  dns_ctx_handle_t *h = data; 
    9292  eventer_t e = NULL, newe = NULL; 
    93   if(ctx == NULL) e = eventer_remove(h->timeout); 
     93  if(h == NULL) return; 
     94  if(ctx == NULL) { 
     95    if(h->timeout) e = eventer_remove(h->timeout); 
     96  } 
    9497  else { 
    9598    assert(h->ctx == ctx); 
     
    111114static void dns_ctx_handle_free(void *vh) { 
    112115  dns_ctx_handle_t *h = vh; 
    113   assert(h->timeout == NULL); 
    114116  free(h->ns); 
     117  eventer_remove_fd(h->e->fd); 
     118  eventer_free(h->e); 
     119  h->e = NULL; 
     120  if(h->timeout) { 
     121    eventer_remove(h->timeout); 
     122    eventer_free(h->timeout); 
     123    h->timeout = NULL; 
     124  } 
    115125  dns_close(h->ctx); 
    116126  dns_free(h->ctx); 
     127  assert(h->timeout == NULL); 
     128  free(h); 
    117129} 
    118130 
     
    200212  ci = get_ci(L); 
    201213  assert(ci); 
    202  
     214  if(lua_gettop(L) > 0) 
     215    nameserver = lua_tostring(L, 1); 
    203216  holder = (dns_lookup_ctx_t **)lua_newuserdata(L, sizeof(*holder)); 
    204217  dlc = calloc(1, sizeof(*dlc));