util.sasl_cyrus: Protect the call to cyrussasl.server_new properly.
[prosody.git] / core / s2smanager.lua
index ccd8161fc78899cf0765259e6c06ebb31098ca8b..f0b802d87e50c164b0e84e9fd7a24a5d6e302178 100644 (file)
@@ -369,11 +369,6 @@ function streamopened(session, attr)
                session.secure = true;
        end
        
-       if session.version >= 1.0 and not (attr.to and attr.from) then
-               (session.log or log)("warn", "Remote of stream "..(session.from_host or "(unknown)").."->"..(session.to_host or "(unknown)")
-                       .." failed to specify to (%s) and/or from (%s) hostname as per RFC", tostring(attr.to), tostring(attr.from));
-       end
-       
        if session.direction == "incoming" then
                -- Send a reply stream header
                session.to_host = attr.to and nameprep(attr.to);
@@ -533,6 +528,7 @@ function retire_session(session)
 end
 
 function destroy_session(session, reason)
+       if session.destroyed then return; end
        (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host));
        
        if session.direction == "outgoing" then