aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-09-29 10:50:27 +0200
committerKim Alvefur <zash@zash.se>2017-09-29 10:50:27 +0200
commitdb450adf9e7f6dbb96cddb15a8b929f367435981 (patch)
treeb34b6de4263d77c6e57ad674ad6e77446a3924fb /net/server_epoll.lua
parent5e5c698a9368fea84b4229749c4454ef4b80c6b2 (diff)
downloadprosody-db450adf9e7f6dbb96cddb15a8b929f367435981.tar.gz
prosody-db450adf9e7f6dbb96cddb15a8b929f367435981.zip
net.server_epoll: Add interface:server() method to match server_event (fixes c2s:show traceback in telnet console)
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 5342ca9d..a88aad12 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -167,6 +167,10 @@ function interface:getfd()
return _SOCKETINVALID;
end
+function interface:server()
+ return self._server or self;
+end
+
-- Get IP address
function interface:ip()
return self.peername or self.sockname;
@@ -186,8 +190,8 @@ end
function interface:serverport()
if self.sockport then
return self.sockport;
- elseif self.server then
- self.server:port();
+ elseif self._server then
+ self._server:port();
end
end
@@ -465,7 +469,7 @@ local function wrapsocket(client, server, pattern, listeners, tls) -- luasocket
client:settimeout(0);
local conn = setmetatable({
conn = client;
- server = server;
+ _server = server;
created = gettime();
listeners = listeners;
_pattern = pattern or (server and server._pattern);