aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_component.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-12-18 18:36:54 +0100
committerKim Alvefur <zash@zash.se>2013-12-18 18:36:54 +0100
commitece61cbae173be6abb4750578252f72c57b8eb8c (patch)
tree88339680df2e8df686a62d99a6c5bd28d1643de2 /plugins/mod_component.lua
parent535e8c110294835d941ac834e88eeb8bb84d14f1 (diff)
parenta3dab92bb38f3c5b014cd94d646d74395424cfe3 (diff)
downloadprosody-ece61cbae173be6abb4750578252f72c57b8eb8c.tar.gz
prosody-ece61cbae173be6abb4750578252f72c57b8eb8c.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r--plugins/mod_component.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 3eaacb8e..1497b12f 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -25,6 +25,8 @@ local hosts = prosody.hosts;
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 @@ function module.add_host(module)
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 @@ function listener.onconnect(conn)
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);