aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/xmppclient_listener.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua
index 223fa89b..61622c6a 100644
--- a/net/xmppclient_listener.lua
+++ b/net/xmppclient_listener.lua
@@ -27,6 +27,9 @@ local sm_streamopened = sessionmanager.streamopened;
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 @@ function xmppclient.onincoming(conn, data)
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;