diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-17 23:27:48 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-17 23:27:48 +0100 |
commit | 7b8100dc081e37bd45c1baaf100e2580fe302d06 (patch) | |
tree | 17362e78d9ab4d4fac98523619e7489734e603a8 | |
parent | c9b83c46682de98ed66585e50c2119f6453620db (diff) | |
download | prosody-7b8100dc081e37bd45c1baaf100e2580fe302d06.tar.gz prosody-7b8100dc081e37bd45c1baaf100e2580fe302d06.zip |
net.server_epoll: Save log tag in a field on FD watchers too
As with 0e1701197722
-rw-r--r-- | net/server_epoll.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 3a2dcbad..d6174a4e 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -383,7 +383,7 @@ function interface:onreadable() end if err ~= "timeout" then self:on("disconnect", err); - self:destroy() + self:close() return; end end @@ -802,7 +802,8 @@ local function watchfd(fd, onreadable, onwritable) end; -- Otherwise it'll need to be something LuaSocket-compatible end - conn.log = logger.init(("fdwatch%s"):format(new_id())); + conn.id = new_id(); + conn.log = logger.init(("fdwatch%s"):format(conn.id)); conn:add(onreadable, onwritable); return conn; end; @@ -911,7 +912,8 @@ return { fds[fd] = nil; end; }, interface_mt); - conn.log = logger.init(("fdwatch%d"):format(conn:getfd())); + conn.id = conn:getfd(); + conn.log = logger.init(("fdwatch%d"):format(conn.id)); local ok, err = conn:add(mode == "r" or mode == "rw", mode == "w" or mode == "rw"); if not ok then return ok, err; end return conn; |