mod_c2s, mod_s2s: Bootstrap connection count statistic on module load
[prosody.git] / plugins / mod_s2s / mod_s2s.lua
index 16320ad169afd651a081daaa4d05f23556aead9a..ea186cf0f265f48d5e1d5139b21679a42bcc1281 100644 (file)
@@ -43,6 +43,16 @@ local sessions = module:shared("sessions");
 
 local log = module._log;
 
+do
+       -- Connection counter resets to 0 on load and reload
+       -- Bump it up to current value
+       local count = 0;
+       for _ in pairs(sessions) do
+               count = count + 1;
+       end
+       measure_connections(count);
+end
+
 --- Handle stanzas to remote domains
 
 local bouncy_stanzas = { message = true, presence = true, iq = true };
@@ -434,9 +444,6 @@ end
 
 local function handleerr(err) log("error", "Traceback[s2s]: %s", traceback(tostring(err), 2)); end
 function stream_callbacks.handlestanza(session, stanza)
-       if stanza.attr.xmlns == "jabber:client" then --COMPAT: Prosody pre-0.6.2 may send jabber:client
-               stanza.attr.xmlns = nil;
-       end
        stanza = session.filter("stanzas/in", stanza);
        if stanza then
                return xpcall(function () return core_process_stanza(session, stanza) end, handleerr);