aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 9feba360..a2052875 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -775,6 +775,10 @@ local function addclient(addr, port, listeners, read_size, tls_ctx, typ, extra)
if not ok and err ~= "timeout" then return ok, err; end
local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx, extra)
local ok, err = client:init();
+ if not client.peername then
+ -- otherwise not set until connected
+ client.peername, client.peerport = addr, port;
+ end
if not ok then return ok, err; end
client:debug("Client %s created", client);
if tls_ctx then