net.server_select: Optimization, clean bufferqueue when it makes sense.
[prosody.git] / core / s2smanager.lua
index ece90e8f39ae91bf2443c966108b5bbb982c3314..6049e12eb5f8305da2dd3022fbaad008458468c9 100644 (file)
@@ -35,7 +35,7 @@ function new_incoming(conn)
                getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end;
        end
        open_sessions = open_sessions + 1;
-       session.log = logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$"));
+       session.log = logger_init("s2sin"..tostring(session):match("[a-f0-9]+$"));
        incoming_s2s[session] = true;
        return session;
 end
@@ -74,7 +74,7 @@ function make_authenticated(session, host)
        else
                return false;
        end
-       session.log("debug", "connection %s->%s is now authenticated for %s", session.from_host or "(unknown)", session.to_host or "(unknown)", host);
+       session.log("debug", "connection %s->%s is now authenticated for %s", session.from_host, session.to_host, host);
        
        mark_connected(session);
        
@@ -96,7 +96,7 @@ function mark_connected(session)
        else
                local host_session = hosts[to];
                session.send = function(stanza)
-                       host_session.events.fire_event("route/remote", { from_host = to, to_host = from, stanza = stanza });
+                       return host_session.events.fire_event("route/remote", { from_host = to, to_host = from, stanza = stanza });
                end;
 
                prosody.events.fire_event("s2sin-established", event_data);