aboutsummaryrefslogtreecommitdiff
path: root/src/tcp.c
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2012-04-24 00:47:30 +0800
committerDiego Nehab <diego.nehab@gmail.com>2012-04-24 00:47:30 +0800
commitc2e29537f576a7082247091036c7957479d42b21 (patch)
treefb6a4da9566e8413d824522ca9a7fb94de049b61 /src/tcp.c
parent1acf8188cd732de4fd5fcdc016eeab501c86a773 (diff)
downloadluasocket-c2e29537f576a7082247091036c7957479d42b21.tar.gz
luasocket-c2e29537f576a7082247091036c7957479d42b21.tar.bz2
luasocket-c2e29537f576a7082247091036c7957479d42b21.zip
Fixed getpeername/getsockname situation
- Added IPv6 support to getsockname - Simplified getpeername implementation - Added family to return of getsockname and getpeername and added modification to the manual to describe
Diffstat (limited to 'src/tcp.c')
-rw-r--r--src/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tcp.c b/src/tcp.c
index 872b1c6..9e1e2bd 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -337,13 +337,13 @@ error:
337static int meth_getpeername(lua_State *L) 337static int meth_getpeername(lua_State *L)
338{ 338{
339 p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); 339 p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
340 return inet_meth_getpeername(L, &tcp->sock); 340 return inet_meth_getpeername(L, &tcp->sock, tcp->family);
341} 341}
342 342
343static int meth_getsockname(lua_State *L) 343static int meth_getsockname(lua_State *L)
344{ 344{
345 p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); 345 p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
346 return inet_meth_getsockname(L, &tcp->sock); 346 return inet_meth_getsockname(L, &tcp->sock, tcp->family);
347} 347}
348 348
349/*-------------------------------------------------------------------------*\ 349/*-------------------------------------------------------------------------*\