aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-29 15:00:28 +0200
committerKim Alvefur <zash@zash.se>2019-09-29 15:00:28 +0200
commit315959a49a675d2f95610828ddcc66d2f1fb535c (patch)
treea5302b890a1e1b5073f6b62ebbbc1521cd354008
parent2aedce23760830b08c7cdd76b1164f9e6f2fbea9 (diff)
downloadprosody-315959a49a675d2f95610828ddcc66d2f1fb535c.tar.gz
prosody-315959a49a675d2f95610828ddcc66d2f1fb535c.zip
net.server_epoll: Make log tag accessible as a field
To allow referencing connections by id instead of tostring form
-rw-r--r--net/server_epoll.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index fd9e0416..633b038c 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -567,6 +567,7 @@ end
local function wrapsocket(client, server, read_size, listeners, tls_ctx, extra) -- luasocket object -> interface object
client:settimeout(0);
+ local conn_id = ("conn%s"):format(new_id());
local conn = setmetatable({
conn = client;
_server = server;
@@ -576,7 +577,8 @@ local function wrapsocket(client, server, read_size, listeners, tls_ctx, extra)
writebuffer = {};
tls_ctx = tls_ctx or (server and server.tls_ctx);
tls_direct = server and server.tls_direct;
- log = logger.init(("conn%s"):format(new_id()));
+ id = conn_id;
+ log = logger.init(conn_id);
extra = extra;
}, interface_mt);