@jorgempy We change the API of DNS callback format back

Make the net api universe  Callback Format -> function(conn,ip)
This commit is contained in:
MarsTechHAN 2015-06-20 19:10:01 +08:00
parent 75c3cf29c2
commit 04c03b00ae
1 changed files with 3 additions and 1 deletions

View File

@ -224,7 +224,9 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
*/ */
// "enhanced" // "enhanced"
lua_rawgeti(gL, LUA_REGISTRYINDEX, nud->cb_dns_found_ref); // the callback function 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) if(ipaddr == NULL)
{ {
@ -242,7 +244,7 @@ static void net_dns_found(const char *name, ip_addr_t *ipaddr, void *arg)
} }
// "enhanced" end // "enhanced" end
lua_call(gL, 1, 0); lua_call(gL, 2, 0);
end: end:
if((pesp_conn->type == ESPCONN_TCP && pesp_conn->proto.tcp->remote_port == 0) if((pesp_conn->type == ESPCONN_TCP && pesp_conn->proto.tcp->remote_port == 0)