Changeset 95f54849093d7581fcc34d6d1012b021926f2d30

Show
Ignore:
Timestamp:
04/20/10 19:35:43 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1271792143 +0000
git-parent:

[3f527b7ecffdd1f7c513261c8d8fb69e94135a7e]

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

that's just painful code copying and fixing. Hopefully, this will ultimately result in replacing the DNS C module with lua code so I only have to fix bugs in one of these nasties. refs #269

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/Makefile.in

    r2bc357a r95f5484  
    3838selfcheck.lo:   selfcheck.xmlh 
    3939 
    40 lua.@MODULEEXT@:        lua.lo lua_noit.lo lua_lpack.lo 
    41         @$(MODULELD) $(LDFLAGS) -o $@ lua.lo lua_noit.lo lua_lpack.lo ../lua/liblua.lo 
     40lua.@MODULEEXT@:        lua.lo lua_noit.lo lua_lpack.lo lua_dns.lo 
     41        @$(MODULELD) $(LDFLAGS) -o $@ lua.lo lua_noit.lo lua_dns.lo lua_lpack.lo ../lua/liblua.lo 
    4242        @echo "- linking $@" 
    4343 
     
    4848lua_noit.lo:    lua_noit.c 
    4949        @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua_noit.c -o $@ 
     50        @echo "- compiling $<" 
     51 
     52lua_dns.lo:     lua_dns.c 
     53        @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua_dns.c -o $@ 
    5054        @echo "- compiling $<" 
    5155 
  • src/modules/lua.c

    r2bc357a r95f5484  
    750750  return 0; 
    751751} 
     752static int noit_lua_panic(lua_State *L) { 
     753  assert(L == NULL); 
     754  return 0; 
     755} 
    752756static noit_module_t * 
    753757noit_lua_loader_load(noit_module_loader_t *loader, 
     
    776780 
    777781  L = lmc->lua_state = lua_open(); 
    778  
     782  lua_atpanic(L, &noit_lua_panic); 
    779783 
    780784  lua_gc(L, LUA_GCSTOP, 0);  /* stop collector during initialization */ 
  • src/modules/lua_noit.c

    r84443b8 r95f5484  
    15781578  { "gettimeofday", nl_gettimeofday }, 
    15791579  { "socket", nl_socket }, 
     1580  { "dns", nl_dns_lookup }, 
    15801581  { "log", nl_log }, 
    15811582  { "base64_decode", nl_base64_decode }, 
     
    16021603  lua_setfield(L, -2, "__index"); 
    16031604 
     1605  luaL_newmetatable(L, "noit.dns"); 
     1606  lua_pushcfunction(L, noit_lua_dns_gc); 
     1607  lua_setfield(L, -2, "__gc"); 
     1608  luaL_newmetatable(L, "noit.dns"); 
     1609  lua_pushcfunction(L, noit_lua_dns_index_func); 
     1610  lua_setfield(L, -2, "__index"); 
     1611 
    16041612  luaL_newmetatable(L, "noit.gunzip"); 
    16051613  lua_pushcfunction(L, noit_lua_gunzip_gc); 
     
    16401648                        noit_lua_socket_connect_complete); 
    16411649  eventer_name_callback("lua/ssl_upgrade", noit_lua_ssl_upgrade); 
    1642 
     1650  noit_lua_init_dns(); 
     1651
  • src/modules/lua_noit.h

    r2bc357a r95f5484  
    101101 
    102102void noit_lua_init(); 
     103void noit_lua_init_dns(); 
     104int noit_lua_dns_gc(lua_State *L); 
     105int noit_lua_dns_index_func(lua_State *L); 
     106int nl_dns_lookup(lua_State *L); 
    103107int luaopen_noit(lua_State *L); 
    104108int luaopen_pack(lua_State *L); /* from lua_lpack.c */