aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-11-22 03:20:35 +0000
committerMatthew Wild <mwild1@gmail.com>2009-11-22 03:20:35 +0000
commit920c067b7ffe42f6a18a0561191f9bbc523a8864 (patch)
tree6003456fe911109aea79427cb6e439b664d883ef
parentd1205508582c22acda941e3853dc8ef049341f92 (diff)
downloadprosody-920c067b7ffe42f6a18a0561191f9bbc523a8864.tar.gz
prosody-920c067b7ffe42f6a18a0561191f9bbc523a8864.zip
net.server_event: Define id property for connection objects, to aid logging
-rw-r--r--net/server_event.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index 453a1f28..60ff5b72 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -444,6 +444,7 @@ do
_sslctx = sslctx; -- parameters
_usingssl = false; -- client is using ssl;
}
+ interface.id = tostring(interface):match("%x+$");
interface.writecallback = function( event ) -- called on write events
--vdebug( "new client write event, id/ip/port:", interface, ip, port )
if interface.nowriting or ( interface.fatalerror and ( "client to close" ~= interface.fatalerror ) ) then -- leave this event
@@ -592,6 +593,7 @@ do
fatalerror = false; -- error message
nointerface = true; -- lock/unlock parameter
}
+ interface.id = tostring(interface):match("%x+$");
interface.readcallback = function( event ) -- server handler, called on incoming connections
--vdebug( "server can accept, id/addr/port:", interface, addr, port )
if interface.fatalerror then