Software / code / prosody
Comparison
plugins/mod_c2s.lua @ 7868:11fcdef5022f
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 26 Jan 2017 19:47:33 +0100 |
| parent | 7666:03aa330562ed |
| parent | 7866:b6d99132d7dc |
| child | 7957:083c062c2fb7 |
comparison
equal
deleted
inserted
replaced
| 7861:58dbe5afeb4a | 7868:11fcdef5022f |
|---|---|
| 37 local stream_callbacks = { default_ns = "jabber:client" }; | 37 local stream_callbacks = { default_ns = "jabber:client" }; |
| 38 local listener = {}; | 38 local listener = {}; |
| 39 local runner_callbacks = {}; | 39 local runner_callbacks = {}; |
| 40 | 40 |
| 41 module:hook("stats-update", function () | 41 module:hook("stats-update", function () |
| 42 -- Connection counter resets to 0 on load and reload | |
| 43 -- Bump it up to current value | |
| 44 local count = 0; | 42 local count = 0; |
| 45 for _ in pairs(sessions) do | 43 for _ in pairs(sessions) do |
| 46 count = count + 1; | 44 count = count + 1; |
| 47 end | 45 end |
| 48 measure_connections(count); | 46 measure_connections(count); |
| 94 local features = st.stanza("stream:features"); | 92 local features = st.stanza("stream:features"); |
| 95 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features }); | 93 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features }); |
| 96 if features.tags[1] or session.full_jid then | 94 if features.tags[1] or session.full_jid then |
| 97 send(features); | 95 send(features); |
| 98 else | 96 else |
| 99 (session.log or log)("warn", "No features to offer"); | 97 (session.log or log)("warn", "No stream features to offer"); |
| 100 session:close{ condition = "undefined-condition", text = "No features to proceed with" }; | 98 session:close{ condition = "undefined-condition", text = "No stream features to proceed with" }; |
| 101 end | 99 end |
| 102 end | 100 end |
| 103 | 101 |
| 104 function stream_callbacks.streamclosed(session) | 102 function stream_callbacks.streamclosed(session) |
| 105 session.log("debug", "Received </stream:stream>"); | 103 session.log("debug", "Received </stream:stream>"); |