aboutsummaryrefslogtreecommitdiff
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
commit27cd0ecd736d985dcc7f7850ed91ce1275e6f386 (patch)
tree6a691ddd4d893da78007fd8f640a54e42e1809fb
parent39e2d7ab214fca70c74bee4fe786cf961fface4e (diff)
downloadprosody-im-server-27cd0ecd736d985dcc7f7850ed91ce1275e6f386.tar
prosody-im-server-27cd0ecd736d985dcc7f7850ed91ce1275e6f386.zip
net.server_epoll: Add interface:server() method to match server_event (fixes c2s:show traceback in telnet console)
-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);