diff options
author | Kim Alvefur <zash@zash.se> | 2017-09-29 10:50:27 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-09-29 10:50:27 +0200 |
commit | db450adf9e7f6dbb96cddb15a8b929f367435981 (patch) | |
tree | b34b6de4263d77c6e57ad674ad6e77446a3924fb /net | |
parent | 5e5c698a9368fea84b4229749c4454ef4b80c6b2 (diff) | |
download | prosody-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')
-rw-r--r-- | net/server_epoll.lua | 10 |
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); |