Software /
code /
prosody
Comparison
net/server_epoll.lua @ 10332:e05ea8223b32
net.server_epoll: Save IP and port from connection creation call
Might come out of :getpeername different later but at least it's something.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 12 Oct 2019 20:22:07 +0200 |
parent | 10331:76bd77ad6a2a |
child | 10416:6af8c812a885 |
comparison
equal
deleted
inserted
replaced
10331:76bd77ad6a2a | 10332:e05ea8223b32 |
---|---|
773 if not ok then return ok, err; end | 773 if not ok then return ok, err; end |
774 local ok, err = conn:setpeername(addr, port); | 774 local ok, err = conn:setpeername(addr, port); |
775 if not ok and err ~= "timeout" then return ok, err; end | 775 if not ok and err ~= "timeout" then return ok, err; end |
776 local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx, extra) | 776 local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx, extra) |
777 local ok, err = client:init(); | 777 local ok, err = client:init(); |
778 if not client.peername then | |
779 -- otherwise not set until connected | |
780 client.peername, client.peerport = addr, port; | |
781 end | |
778 if not ok then return ok, err; end | 782 if not ok then return ok, err; end |
779 client:debug("Client %s created", client); | 783 client:debug("Client %s created", client); |
780 if tls_ctx then | 784 if tls_ctx then |
781 client:starttls(tls_ctx); | 785 client:starttls(tls_ctx); |
782 end | 786 end |