1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2025-02-22 18:52:48 +01:00

fix wurl bug

This commit is contained in:
lxsang 2021-02-09 01:13:10 +01:00
parent 36f4dd0941
commit 27d2cbfbfb
2 changed files with 15 additions and 0 deletions

BIN
dist/lua-0.5.2b.tar.gz vendored

Binary file not shown.

View File

@ -35,6 +35,21 @@ typedef struct{
unsigned char* data ; unsigned char* data ;
} wurl_header_t; } wurl_header_t;
byte_array_t *l_check_barray (lua_State *L,int idx) {
void *ud = luaL_checkudata(L, idx, BYTEARRAY);
luaL_argcheck(L, ud != NULL, idx, "`byte array' expected");
return (byte_array_t *)ud;
}
void lua_new_byte_array(lua_State*L, int n)
{
size_t nbytes = sizeof(byte_array_t) + (n-1)*sizeof(unsigned char);
byte_array_t *a = (byte_array_t *)lua_newuserdata(L, nbytes);
luaL_getmetatable(L, BYTEARRAY);
lua_setmetatable(L, -2);
a->size = n;
}
/*get the ip by hostname*/ /*get the ip by hostname*/
int wurl_ip_from_hostname(const char * hostname , char* ip) int wurl_ip_from_hostname(const char * hostname , char* ip)
{ {