diff options
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)); |
