From aa15ed7020f549613e41d5efd133a21373fa406f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 24 Jul 2013 15:28:36 +0200 Subject: mod_c2s: Change default of tcp_keepalives to true, and make it individually configurable through c2s_tcp_keepalives --- plugins/mod_c2s.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 1d2dd6dd..b2a81592 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -25,7 +25,7 @@ local log = module._log; local c2s_timeout = module:get_option_number("c2s_timeout"); local stream_close_timeout = module:get_option_number("c2s_close_timeout", 5); -local opt_keepalives = module:get_option_boolean("tcp_keepalives", false); +local opt_keepalives = module:get_option_boolean("c2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true)); local sessions = module:shared("sessions"); local core_process_stanza = prosody.core_process_stanza; -- cgit v1.2.3 From 14d72bec0f68fde660609ff40be1e9d86c543598 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 24 Jul 2013 21:49:36 +0200 Subject: adhoc.lib: Don't build error reply from reply stanza --- plugins/adhoc/adhoc.lib.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua index ecddcd1d..b544ddc8 100644 --- a/plugins/adhoc/adhoc.lib.lua +++ b/plugins/adhoc/adhoc.lib.lua @@ -34,7 +34,6 @@ function _M.handle_cmd(command, origin, stanza) local data, state = command:handler(dataIn, states[sessionid]); states[sessionid] = state; - local stanza = st.reply(stanza); local cmdtag; if data.status == "completed" then states[sessionid] = nil; @@ -44,8 +43,8 @@ function _M.handle_cmd(command, origin, stanza) cmdtag = command:cmdtag("canceled", sessionid); elseif data.status == "error" then states[sessionid] = nil; - stanza = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message); - origin.send(stanza); + local reply = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message); + origin.send(reply); return true; else cmdtag = command:cmdtag("executing", sessionid); @@ -78,8 +77,9 @@ function _M.handle_cmd(command, origin, stanza) cmdtag:add_child(content); end end - stanza:add_child(cmdtag); - origin.send(stanza); + local reply = st.reply(stanza); + reply:add_child(cmdtag); + origin.send(reply); return true; end -- cgit v1.2.3