Comparison

core/s2smanager.lua @ 157:f4e9b6ec34b0

Hack until we get SRV resolving
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Oct 2008 14:59:04 +0100
parent 148:4c0dcd245d34
child 161:8c1a8a3e32e8
comparison
equal deleted inserted replaced
156:884c43c7028a 157:f4e9b6ec34b0
17 local log = logger_init("s2smanager"); 17 local log = logger_init("s2smanager");
18 18
19 local md5_hash = require "util.hashes".md5; 19 local md5_hash = require "util.hashes".md5;
20 20
21 local dialback_secret = "This is very secret!!! Ha!"; 21 local dialback_secret = "This is very secret!!! Ha!";
22
23 local srvmap = { ["gmail.com"] = "talk.google.com", ["identi.ca"] = "longlance.controlezvous.ca" };
22 24
23 module "s2smanager" 25 module "s2smanager"
24 26
25 function connect_host(from_host, to_host) 27 function connect_host(from_host, to_host)
26 end 28 end
62 64
63 local cl = connlisteners_get("xmppserver"); 65 local cl = connlisteners_get("xmppserver");
64 66
65 local conn, handler = socket.tcp() 67 local conn, handler = socket.tcp()
66 --FIXME: Below parameters (ports/ip) are incorrect (use SRV) 68 --FIXME: Below parameters (ports/ip) are incorrect (use SRV)
69 to_host = srvmap[to_host] or to_host;
67 conn:connect(to_host, 5269); 70 conn:connect(to_host, 5269);
68 conn = wraptlsclient(cl, conn, to_host, 5269, 0, 1, hosts[from_host].ssl_ctx ); 71 conn = wraptlsclient(cl, conn, to_host, 5269, 0, 1, hosts[from_host].ssl_ctx );
69 host_session.conn = conn; 72 host_session.conn = conn;
70 73
71 -- Register this outgoing connection so that xmppserver_listener knows about it 74 -- Register this outgoing connection so that xmppserver_listener knows about it