Comparison

plugins/mod_c2s.lua @ 11746:68faaf936f6d 0.11

mod_c2s: Indicate stream secure state in error text when no stream features to offer
author Matthew Wild <mwild1@gmail.com>
date Tue, 06 Jul 2021 08:18:28 +0100
parent 11540:1937b3c3efb5
child 11747:9f723b54e111
comparison
equal deleted inserted replaced
11712:d117b92fd8e4 11746:68faaf936f6d
106 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features }); 106 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features });
107 if features.tags[1] or session.full_jid then 107 if features.tags[1] or session.full_jid then
108 send(features); 108 send(features);
109 else 109 else
110 (session.log or log)("warn", "No stream features to offer"); 110 (session.log or log)("warn", "No stream features to offer");
111 session:close{ condition = "undefined-condition", text = "No stream features to proceed with" }; 111 session:close({
112 condition = "undefined-condition";
113 text = "No stream features to proceed with on "..(session.secure and "" or "in").."secure stream";
114 });
112 end 115 end
113 end 116 end
114 117
115 function stream_callbacks.streamclosed(session) 118 function stream_callbacks.streamclosed(session)
116 session.log("debug", "Received </stream:stream>"); 119 session.log("debug", "Received </stream:stream>");