Software /
code /
prosody
Comparison
core/s2smanager.lua @ 10243:b36765ab0ae3
core.s2smanager: Add [direction] boolean flags to s2s connections
This will allow representing connections that go both directions
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 07 Sep 2019 17:31:26 +0200 |
parent | 10103:18cab054364a |
child | 10244:483cc47f15f8 |
comparison
equal
deleted
inserted
replaced
10242:7e5d2a6c9390 | 10243:b36765ab0ae3 |
---|---|
29 local host_session = sessionlib.new("s2sin"); | 29 local host_session = sessionlib.new("s2sin"); |
30 sessionlib.set_id(host_session); | 30 sessionlib.set_id(host_session); |
31 sessionlib.set_logger(host_session); | 31 sessionlib.set_logger(host_session); |
32 sessionlib.set_conn(host_session, conn); | 32 sessionlib.set_conn(host_session, conn); |
33 host_session.direction = "incoming"; | 33 host_session.direction = "incoming"; |
34 host_session.incoming = true; | |
34 host_session.hosts = {}; | 35 host_session.hosts = {}; |
35 incoming_s2s[host_session] = true; | 36 incoming_s2s[host_session] = true; |
36 return host_session; | 37 return host_session; |
37 end | 38 end |
38 | 39 |
43 host_session.to_host = to_host; | 44 host_session.to_host = to_host; |
44 host_session.from_host = from_host; | 45 host_session.from_host = from_host; |
45 host_session.host = from_host; | 46 host_session.host = from_host; |
46 host_session.notopen = true; | 47 host_session.notopen = true; |
47 host_session.direction = "outgoing"; | 48 host_session.direction = "outgoing"; |
49 host_session.outgoing = true; | |
48 hosts[from_host].s2sout[to_host] = host_session; | 50 hosts[from_host].s2sout[to_host] = host_session; |
49 return host_session; | 51 return host_session; |
50 end | 52 end |
51 | 53 |
52 local resting_session = { -- Resting, not dead | 54 local resting_session = { -- Resting, not dead |