Comparison

plugins/mod_c2s.lua @ 9739:a74d78f79b23

mod_c2s: Improve log message in case there are no stream features on offer (thanks hexa)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Dec 2018 00:13:03 +0100
parent 9490:6e4fbd12c11c
child 9784:7fa273f8869e
comparison
equal deleted inserted replaced
9738:f5aa6fdc935e 9739:a74d78f79b23
104 local features = st.stanza("stream:features"); 104 local features = st.stanza("stream:features");
105 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features }); 105 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features });
106 if features.tags[1] or session.full_jid then 106 if features.tags[1] or session.full_jid then
107 send(features); 107 send(features);
108 else 108 else
109 (session.log or log)("warn", "No stream features to offer"); 109 if session.secure then
110 -- Normally STARTTLS would be offered
111 (session.log or log)("warn", "No stream features to offer on secure session. Check authentication settings.");
112 else
113 -- Here SASL should be offered
114 (session.log or log)("warn", "No stream features to offer on insecure session. Check encryption and security settings.");
115 end
110 session:close{ condition = "undefined-condition", text = "No stream features to proceed with" }; 116 session:close{ condition = "undefined-condition", text = "No stream features to proceed with" };
111 end 117 end
112 end 118 end
113 119
114 function stream_callbacks.streamclosed(session) 120 function stream_callbacks.streamclosed(session)