mod_component: Enable TCP keepalives on component streams

This commit is contained in:
Kim Alvefur 2013-12-18 18:35:35 +01:00
parent 72d7753441
commit a3dab92bb3

View file

@ -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)
@ -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);