diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-06-30 06:10:02 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-06-30 06:10:02 +0000 |
commit | 167727be3cefb3f45a26b0b1d96dc94a900a84b4 (patch) | |
tree | bb07db0d01dbdebe6b25162b25fbeefc2ee19d05 /src | |
parent | bd54cd42d4c8a7d6bb9550d8aa0eac243cda63c0 (diff) | |
download | luasocket-167727be3cefb3f45a26b0b1d96dc94a900a84b4.tar.gz luasocket-167727be3cefb3f45a26b0b1d96dc94a900a84b4.tar.bz2 luasocket-167727be3cefb3f45a26b0b1d96dc94a900a84b4.zip |
Bug in usocket_recv...
Diffstat (limited to 'src')
-rw-r--r-- | src/auxiliar.c | 5 | ||||
-rw-r--r-- | src/inet.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/auxiliar.c b/src/auxiliar.c index 8b2fa37..65425c5 100644 --- a/src/auxiliar.c +++ b/src/auxiliar.c | |||
@@ -25,6 +25,11 @@ void aux_open(lua_State *L) | |||
25 | lua_pushnumber(L, 1); | 25 | lua_pushnumber(L, 1); |
26 | lua_rawset(L, -3); | 26 | lua_rawset(L, -3); |
27 | #endif | 27 | #endif |
28 | /* make version string available so scripts */ | ||
29 | lua_pushstring(L, "version"); | ||
30 | lua_pushstring(L, LUASOCKET_VERSION); | ||
31 | lua_rawset(L, -3); | ||
32 | /* store namespace as global */ | ||
28 | lua_settable(L, LUA_GLOBALSINDEX); | 33 | lua_settable(L, LUA_GLOBALSINDEX); |
29 | /* make sure modules know what is our namespace */ | 34 | /* make sure modules know what is our namespace */ |
30 | lua_pushstring(L, "LUASOCKET_LIBNAME"); | 35 | lua_pushstring(L, "LUASOCKET_LIBNAME"); |
@@ -177,7 +177,6 @@ const char *inet_tryconnect(p_sock ps, const char *address, | |||
177 | if (!strlen(address) || !inet_aton(address, &remote.sin_addr)) { | 177 | if (!strlen(address) || !inet_aton(address, &remote.sin_addr)) { |
178 | struct hostent *hp = gethostbyname(address); | 178 | struct hostent *hp = gethostbyname(address); |
179 | struct in_addr **addr; | 179 | struct in_addr **addr; |
180 | remote.sin_family = AF_INET; | ||
181 | if (!hp) return sock_hoststrerror(); | 180 | if (!hp) return sock_hoststrerror(); |
182 | addr = (struct in_addr **) hp->h_addr_list; | 181 | addr = (struct in_addr **) hp->h_addr_list; |
183 | memcpy(&remote.sin_addr, *addr, sizeof(struct in_addr)); | 182 | memcpy(&remote.sin_addr, *addr, sizeof(struct in_addr)); |