Diff

plugins/mod_bosh.lua @ 11126:cc6b1dab01a2

mod_bosh: Count connection attempts non-VirtualHost as "bad host" (stats)
author Kim Alvefur <zash@zash.se>
date Sat, 03 Oct 2020 15:09:12 +0200
parent 11125:5bcddab1659b
child 11391:8eff5c744395
line wrap: on
line diff
--- a/plugins/mod_bosh.lua	Sat Oct 03 15:07:48 2020 +0200
+++ b/plugins/mod_bosh.lua	Sat Oct 03 15:09:12 2020 +0200
@@ -293,6 +293,7 @@
 
 		if not prosody.hosts[to_host] then
 			log("debug", "BOSH client tried to connect to non-existant host: %s", attr.to);
+			report_bad_host();
 			local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
 				["xmlns:stream"] = xmlns_streams, condition = "improper-addressing" });
 			response:send(tostring(close_reply));
@@ -301,6 +302,7 @@
 
 		if prosody.hosts[to_host].type ~= "local" then
 			log("debug", "BOSH client tried to connect to %s host: %s", prosody.hosts[to_host].type, attr.to);
+			report_bad_host();
 			local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
 				["xmlns:stream"] = xmlns_streams, condition = "improper-addressing" });
 			response:send(tostring(close_reply));