xmppclient_listener: Allow the tcp_keepalives option in the config to control whether keepalives are used
--- a/net/xmppclient_listener.lua Tue Jan 12 15:16:22 2010 +0000
+++ b/net/xmppclient_listener.lua Tue Jan 12 15:17:08 2010 +0000
@@ -27,6 +27,9 @@
local sm_streamclosed = sessionmanager.streamclosed;
local st = require "util.stanza";
+local config = require "core.configmanager";
+local opt_keepalives = config.get("*", "core", "tcp_keepalives");
+
local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams\1stream",
default_ns = "jabber:client",
streamopened = sm_streamopened, streamclosed = sm_streamclosed, handlestanza = core_process_stanza };
@@ -121,6 +124,10 @@
session.secure = true;
end
+ if opt_keepalives ~= nil then
+ conn:setoption("keepalive", opt_keepalives);
+ end
+
session.reset_stream = session_reset_stream;
session.close = session_close;