mod_dialback, mod_saslauth: Remove broken fallback to dialback on SASL EXTERNAL failure
[prosody.git] / plugins / mod_s2s / s2sout.lib.lua
index ec8ea4d47941e7bc7faddd2cc5b751edbc3b4c4d..942a618d6244b86ae09b705b894810ca4fc3483f 100644 (file)
@@ -270,6 +270,7 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
        -- Reset secure flag in case this is another
        -- connection attempt after a failed STARTTLS
        host_session.secure = nil;
+       host_session.encrypted = nil;
 
        local conn, handler;
        local proto = connect_host.proto;
@@ -296,21 +297,6 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
        conn = wrapclient(conn, connect_host.addr, connect_port, s2s_listener, "*a");
        host_session.conn = conn;
 
-       local filter = initialize_filters(host_session);
-       local w, log = conn.write, host_session.log;
-       host_session.sends2s = function (t)
-               log("debug", "sending: %s", (t.top_tag and t:top_tag()) or t:match("^[^>]*>?"));
-               if t.name then
-                       t = filter("stanzas/out", t);
-               end
-               if t then
-                       t = filter("bytes/out", tostring(t));
-                       if t then
-                               return w(conn, tostring(t));
-                       end
-               end
-       end
-
        -- Register this outgoing connection so that xmppserver_listener knows about it
        -- otherwise it will assume it is a new incoming connection
        s2s_listener.register_outgoing(conn, host_session);
@@ -347,6 +333,9 @@ module:hook_global("service-added", function (event)
                        has_ipv4 = true;
                end
        end
+       if not (has_ipv4 or has_ipv6)  then
+               module:log("warn", "No local IPv4 or IPv6 addresses detected, outgoing connections may fail");
+       end
 end);
 
 return s2sout;