Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 7868:11fcdef5022f
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 26 Jan 2017 19:47:33 +0100 |
parent | 7686:8d6f367bed8c |
parent | 7866:b6d99132d7dc |
child | 8235:7d9a2c200736 |
comparison
equal
deleted
inserted
replaced
7861:58dbe5afeb4a | 7868:11fcdef5022f |
---|---|
45 local runner_callbacks = {}; | 45 local runner_callbacks = {}; |
46 | 46 |
47 local log = module._log; | 47 local log = module._log; |
48 | 48 |
49 module:hook("stats-update", function () | 49 module:hook("stats-update", function () |
50 -- Connection counter resets to 0 on load and reload | |
51 -- Bump it up to current value | |
52 local count = 0; | 50 local count = 0; |
53 for _ in pairs(sessions) do | 51 for _ in pairs(sessions) do |
54 count = count + 1; | 52 count = count + 1; |
55 end | 53 end |
56 measure_connections(count); | 54 measure_connections(count); |
380 | 378 |
381 if ( session.type == "s2sin" or session.type == "s2sout" ) or features.tags[1] then | 379 if ( session.type == "s2sin" or session.type == "s2sout" ) or features.tags[1] then |
382 log("debug", "Sending stream features: %s", tostring(features)); | 380 log("debug", "Sending stream features: %s", tostring(features)); |
383 session.sends2s(features); | 381 session.sends2s(features); |
384 else | 382 else |
385 (session.log or log)("warn", "No features to offer, giving up"); | 383 (session.log or log)("warn", "No stream features to offer, giving up"); |
386 session:close({ condition = "undefined-condition", text = "No features to offer" }); | 384 session:close({ condition = "undefined-condition", text = "No stream features to offer" }); |
387 end | 385 end |
388 end | 386 end |
389 elseif session.direction == "outgoing" then | 387 elseif session.direction == "outgoing" then |
390 session.notopen = nil; | 388 session.notopen = nil; |
391 if not attr.id then | 389 if not attr.id then |