Comparison

plugins/mod_c2s.lua @ 7466:f28fa742def3

mod_c2s, mod_s2s: Bootstrap connection count statistic on module load
author Kim Alvefur <zash@zash.se>
date Thu, 07 Jul 2016 18:48:58 +0200
parent 7329:ab811c1bb730
child 7467:9a73c85baffe
child 7539:366964dbddb1
comparison
equal deleted inserted replaced
7464:3b7de72e58a9 7466:f28fa742def3
33 local core_process_stanza = prosody.core_process_stanza; 33 local core_process_stanza = prosody.core_process_stanza;
34 local hosts = prosody.hosts; 34 local hosts = prosody.hosts;
35 35
36 local stream_callbacks = { default_ns = "jabber:client" }; 36 local stream_callbacks = { default_ns = "jabber:client" };
37 local listener = {}; 37 local listener = {};
38
39 do
40 -- Connection counter resets to 0 on load and reload
41 -- Bump it up to current value
42 local count = 0;
43 for _ in pairs(sessions) do
44 count = count + 1;
45 end
46 measure_connections(count);
47 end
38 48
39 --- Stream events handlers 49 --- Stream events handlers
40 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; 50 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
41 51
42 function stream_callbacks.streamopened(session, attr) 52 function stream_callbacks.streamopened(session, attr)