fix(inet): Return port as number in getsockname
The documentation of getsockname() states that the port is returned as a number, which is also what the similar getpeername function does. Closes #391
This commit is contained in:
parent
26b524e1d7
commit
d7856b222d
1 changed files with 1 additions and 1 deletions
|
@ -290,7 +290,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family)
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
lua_pushstring(L, name);
|
lua_pushstring(L, name);
|
||||||
lua_pushstring(L, port);
|
lua_pushinteger(L, (int) strtol(port, (char **) NULL, 10));
|
||||||
switch (family) {
|
switch (family) {
|
||||||
case AF_INET: lua_pushliteral(L, "inet"); break;
|
case AF_INET: lua_pushliteral(L, "inet"); break;
|
||||||
case AF_INET6: lua_pushliteral(L, "inet6"); break;
|
case AF_INET6: lua_pushliteral(L, "inet6"); break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue