Comparison

plugins/mod_s2s/mod_s2s.lua @ 6847:c314e9142e9d

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 24 Sep 2015 20:15:19 +0200
parent 6690:b2e89583d6e6
parent 6846:7eb166fa1f26
child 6861:39789f1669cb
comparison
equal deleted inserted replaced
6843:161cccfdf015 6847:c314e9142e9d
352 hosts[to].events.fire_event("s2s-stream-features", { origin = session, features = features }); 352 hosts[to].events.fire_event("s2s-stream-features", { origin = session, features = features });
353 else 353 else
354 (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or session.ip or "unknown host"); 354 (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or session.ip or "unknown host");
355 end 355 end
356 356
357 log("debug", "Sending stream features: %s", tostring(features)); 357 if ( session.type == "s2sin" or session.type == "s2sout" ) or features.tags[1] then
358 session.sends2s(features); 358 log("debug", "Sending stream features: %s", tostring(features));
359 session.sends2s(features);
360 else
361 (session.log or log)("warn", "No features to offer, giving up");
362 session:close({ condition = "undefined-condition", text = "No features to offer" });
363 end
359 end 364 end
360 elseif session.direction == "outgoing" then 365 elseif session.direction == "outgoing" then
361 session.notopen = nil; 366 session.notopen = nil;
362 if not attr.id then 367 if not attr.id then
363 log("error", "Stream response did not give us a stream id!"); 368 log("error", "Stream response did not give us a stream id!");