diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-17 23:47:31 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-17 23:47:31 +0100 |
commit | 970ac1aa6c95fd9d8d1f2de01388dcc5113ef296 (patch) | |
tree | 15646873b83b1d967d3e4a024d20529d3d37fa24 /net | |
parent | 7dc9926e110024b70c497481538615a5f89e31c4 (diff) | |
download | prosody-970ac1aa6c95fd9d8d1f2de01388dcc5113ef296.tar.gz prosody-970ac1aa6c95fd9d8d1f2de01388dcc5113ef296.zip |
net.server_epoll: Save log tag in a field on FD watchers too
As with 0e1701197722
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 3a2dcbad..d44149f3 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -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; |