aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-02-21 23:30:47 +0100
committerKim Alvefur <zash@zash.se>2020-02-21 23:30:47 +0100
commit0b3056c44881ef8692cdb09e520a9368b29dc601 (patch)
treed41e7f8c22918977ef1a06ba428ce6d3a7407ac7 /plugins
parentaa6a550cebc5bc0e8d1c0e5a5174f600d37a4e3f (diff)
downloadprosody-0b3056c44881ef8692cdb09e520a9368b29dc601.tar.gz
prosody-0b3056c44881ef8692cdb09e520a9368b29dc601.zip
mod_ping: Fix double response to internal ping
When responding to a ping from elsewhere in the same Prosody the send function will be host_send from core.hostmanager, which does not return anything. Tailcalling it therefore lets the iq event fall trough to handle_unhandled_stanza in core.stanza_router, which responds with an error. This error also goes into handle_unhandled_stanza which discards it. Noticed because I have a module that points out when a stanza error reply is created without a text argument.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_ping.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_ping.lua b/plugins/mod_ping.lua
index df24c495..b6ccc928 100644
--- a/plugins/mod_ping.lua
+++ b/plugins/mod_ping.lua
@@ -11,7 +11,8 @@ local st = require "util.stanza";
module:add_feature("urn:xmpp:ping");
local function ping_handler(event)
- return event.origin.send(st.reply(event.stanza));
+ event.origin.send(st.reply(event.stanza));
+ return true;
end
module:hook("iq-get/bare/urn:xmpp:ping:ping", ping_handler);