Software /
code /
prosody
Comparison
plugins/mod_component.lua @ 5306:10bc0e2aa55e
s2smanager: Generate session names used for logging the same way everywhere
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 24 Jan 2013 00:58:17 +0100 |
parent | 5298:6d34ed9fce69 |
child | 5316:310c7e5bb906 |
comparison
equal
deleted
inserted
replaced
5305:391b72fede9f | 5306:10bc0e2aa55e |
---|---|
258 function listener.onconnect(conn) | 258 function listener.onconnect(conn) |
259 local _send = conn.write; | 259 local _send = conn.write; |
260 local session = { type = "component_unauthed", conn = conn, send = function (data) return _send(conn, tostring(data)); end }; | 260 local session = { type = "component_unauthed", conn = conn, send = function (data) return _send(conn, tostring(data)); end }; |
261 | 261 |
262 -- Logging functions -- | 262 -- Logging functions -- |
263 local conn_name = "jcp"..tostring(conn):match("[a-f0-9]+$"); | 263 local conn_name = "jcp"..tostring(session):match("[a-f0-9]+$"); |
264 session.log = logger.init(conn_name); | 264 session.log = logger.init(conn_name); |
265 session.close = session_close; | 265 session.close = session_close; |
266 | 266 |
267 session.log("info", "Incoming Jabber component connection"); | 267 session.log("info", "Incoming Jabber component connection"); |
268 | 268 |