42 |
42 |
43 local function compare_srv_priorities(a,b) |
43 local function compare_srv_priorities(a,b) |
44 return a.priority < b.priority or (a.priority == b.priority and a.weight > b.weight); |
44 return a.priority < b.priority or (a.priority == b.priority and a.weight > b.weight); |
45 end |
45 end |
46 |
46 |
47 local function session_open_stream(session, from, to) |
|
48 session.sends2s(st.stanza("stream:stream", { |
|
49 xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', |
|
50 ["xmlns:stream"]='http://etherx.jabber.org/streams', |
|
51 from=from, to=to, version='1.0', ["xml:lang"]='en'}):top_tag()); |
|
52 end |
|
53 |
|
54 function s2sout.initiate_connection(host_session) |
47 function s2sout.initiate_connection(host_session) |
55 initialize_filters(host_session); |
48 initialize_filters(host_session); |
|
49 host_session.version = 1; |
56 host_session.open_stream = session_open_stream; |
50 host_session.open_stream = session_open_stream; |
57 |
51 |
58 -- Kick the connection attempting machine into life |
52 -- Kick the connection attempting machine into life |
59 if not s2sout.attempt_connection(host_session) then |
53 if not s2sout.attempt_connection(host_session) then |
60 -- Intentionally not returning here, the |
54 -- Intentionally not returning here, the |