# HG changeset patch # User Kim Alvefur # Date 1582324247 -3600 # Node ID a2bd6e85a4578997f3a817b821bb0d26c06a49cb # Parent 94f6fb21a764a8dc14a97139fe8839af5a42e77b 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. diff -r 94f6fb21a764 -r a2bd6e85a457 plugins/mod_ping.lua --- a/plugins/mod_ping.lua Fri Feb 21 23:01:43 2020 +0100 +++ b/plugins/mod_ping.lua Fri Feb 21 23:30:47 2020 +0100 @@ -11,7 +11,8 @@ 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);