# HG changeset patch # User Kim Alvefur # Date 1387388258 -3600 # Node ID b3d5aa57c454d2d8d0c44944f14f3c2a1cd083c1 # Parent 09645f58c14c53297a99ec4c10025658194eb491# Parent 6dc73be95213ad283221554652ec0272ebd79418 Merge 0.10->trunk diff -r 09645f58c14c -r b3d5aa57c454 plugins/mod_component.lua --- a/plugins/mod_component.lua Mon Dec 16 23:32:29 2013 +0000 +++ b/plugins/mod_component.lua Wed Dec 18 18:37:38 2013 +0100 @@ -25,6 +25,8 @@ local log = module._log; +local opt_keepalives = module:get_option_boolean("component_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true)); + local sessions = module:shared("sessions"); function module.add_host(module) @@ -86,7 +88,7 @@ return true; end - module:hook("stanza/jabber:component:accept:handshake", handle_component_auth); + module:hook("stanza/jabber:component:accept:handshake", handle_component_auth, -1); -- Handle stanzas addressed to this component local function handle_stanza(event) @@ -270,6 +272,10 @@ session.log = logger.init(conn_name); session.close = session_close; + if opt_keepalives then + conn:setoption("keepalive", opt_keepalives); + end + session.log("info", "Incoming Jabber component connection"); local stream = new_xmpp_stream(session, stream_callbacks);