From 7eb15b0b3fd49a58656e510866349c9725cd27cc Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 3 Oct 2020 15:09:12 +0200 Subject: mod_bosh: Count connection attempts non-VirtualHost as "bad host" (stats) --- plugins/mod_bosh.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index c5f5e044..6393a73e 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -293,6 +293,7 @@ function stream_callbacks.streamopened(context, attr) 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 @@ function stream_callbacks.streamopened(context, attr) 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)); -- cgit v1.2.3