From 04c03b00aef2489c0d31e9e2cfb181c79a985ce4 Mon Sep 17 00:00:00 2001 From: MarsTechHAN Date: Sat, 20 Jun 2015 19:10:01 +0800 Subject: [PATCH] @jorgempy We change the API of DNS callback format back Make the net api universe Callback Format -> function(conn,ip) --- app/modules/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/modules/net.c b/app/modules/net.c index bb36d45b..bbb9f6f0 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -224,7 +224,9 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg) */ // "enhanced" + lua_rawgeti(gL, LUA_REGISTRYINDEX, nud->cb_dns_found_ref); // the callback function + lua_rawgeti(gL, LUA_REGISTRYINDEX, nud->self_ref); // pass the userdata(conn) to callback func in lua if(ipaddr == NULL) { @@ -242,7 +244,7 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg) } // "enhanced" end - lua_call(gL, 1, 0); + lua_call(gL, 2, 0); end: if((pesp_conn->type == ESPCONN_TCP && pesp_conn->proto.tcp->remote_port == 0)