aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
commit9c9d5678b0e9918da455eb49994c747d777b0775 (patch)
treeb34b6de4263d77c6e57ad674ad6e77446a3924fb /net
parent257aa859fec84a4b013b33b3d8174796e86489ad (diff)
downloadprosody-9c9d5678b0e9918da455eb49994c747d777b0775.tar.gz
prosody-9c9d5678b0e9918da455eb49994c747d777b0775.zip
net.server_epoll: Add interface:server() method to match server_event (fixes c2s:show traceback in telnet console)
Diffstat (limited to 'net')
-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);