Bug in usocket_recv...
This commit is contained in:
parent
bd54cd42d4
commit
167727be3c
4 changed files with 62 additions and 52 deletions
|
@ -25,6 +25,11 @@ void aux_open(lua_State *L)
|
|||
lua_pushnumber(L, 1);
|
||||
lua_rawset(L, -3);
|
||||
#endif
|
||||
/* make version string available so scripts */
|
||||
lua_pushstring(L, "version");
|
||||
lua_pushstring(L, LUASOCKET_VERSION);
|
||||
lua_rawset(L, -3);
|
||||
/* store namespace as global */
|
||||
lua_settable(L, LUA_GLOBALSINDEX);
|
||||
/* make sure modules know what is our namespace */
|
||||
lua_pushstring(L, "LUASOCKET_LIBNAME");
|
||||
|
|
|
@ -177,7 +177,6 @@ const char *inet_tryconnect(p_sock ps, const char *address,
|
|||
if (!strlen(address) || !inet_aton(address, &remote.sin_addr)) {
|
||||
struct hostent *hp = gethostbyname(address);
|
||||
struct in_addr **addr;
|
||||
remote.sin_family = AF_INET;
|
||||
if (!hp) return sock_hoststrerror();
|
||||
addr = (struct in_addr **) hp->h_addr_list;
|
||||
memcpy(&remote.sin_addr, *addr, sizeof(struct in_addr));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue