Software /
code /
prosody
Diff
plugins/mod_s2s/mod_s2s.lua @ 5522:3912c9264ef0
mod_s2s: Obey tcp_keepalives option for s2s too, and make it individually configurable through s2s_tcp_keepalives (thanks yeled)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 26 Apr 2013 12:25:25 +0100 |
parent | 5505:0b6a99e6c1b1 |
child | 5533:df3c78221f26 |
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua Thu Apr 25 20:37:20 2013 +0100 +++ b/plugins/mod_s2s/mod_s2s.lua Fri Apr 26 12:25:25 2013 +0100 @@ -33,7 +33,7 @@ local connect_timeout = module:get_option_number("s2s_timeout", 90); local stream_close_timeout = module:get_option_number("s2s_close_timeout", 5); - +local opt_keepalives = module:get_option_boolean("s2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true)); local secure_auth = module:get_option_boolean("s2s_secure_auth", false); -- One day... local secure_domains, insecure_domains = module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items; @@ -563,6 +563,7 @@ end function listener.onconnect(conn) + conn:setoption("keepalive", opt_keepalives); local session = sessions[conn]; if not session then -- New incoming connection session = s2s_new_incoming(conn);