Mercurial > prosody-hg
comparison plugins/mod_s2s/s2sout.lib.lua @ 5394:3d1de30fefec
Merge 0.9->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 28 Mar 2013 12:17:15 +0000 |
| parents | f833d2188c16 |
| children | 40e7a6cf15ff |
comparison
equal
deleted
inserted
replaced
| 5382:214c32e10734 | 5394:3d1de30fefec |
|---|---|
| 88 handle = adns.lookup(function (answer) | 88 handle = adns.lookup(function (answer) |
| 89 handle = nil; | 89 handle = nil; |
| 90 host_session.connecting = nil; | 90 host_session.connecting = nil; |
| 91 if answer and #answer > 0 then | 91 if answer and #answer > 0 then |
| 92 log("debug", "%s has SRV records, handling...", to_host); | 92 log("debug", "%s has SRV records, handling...", to_host); |
| 93 local srv_hosts = {}; | 93 local srv_hosts = { answer = answer }; |
| 94 host_session.srv_hosts = srv_hosts; | 94 host_session.srv_hosts = srv_hosts; |
| 95 for _, record in ipairs(answer) do | 95 for _, record in ipairs(answer) do |
| 96 t_insert(srv_hosts, record.srv); | 96 t_insert(srv_hosts, record.srv); |
| 97 end | 97 end |
| 98 if #srv_hosts == 1 and srv_hosts[1].target == "." then | 98 if #srv_hosts == 1 and srv_hosts[1].target == "." then |
| 269 (host_session.log or log)("info", "Beginning new connection attempt to %s ([%s]:%d)", host_session.to_host, connect_host.addr, connect_port); | 269 (host_session.log or log)("info", "Beginning new connection attempt to %s ([%s]:%d)", host_session.to_host, connect_host.addr, connect_port); |
| 270 -- Ok, we're going to try to connect | 270 -- Ok, we're going to try to connect |
| 271 | 271 |
| 272 local from_host, to_host = host_session.from_host, host_session.to_host; | 272 local from_host, to_host = host_session.from_host, host_session.to_host; |
| 273 | 273 |
| 274 -- Reset secure flag in case this is another | |
| 275 -- connection attempt after a failed STARTTLS | |
| 276 host_session.secure = nil; | |
| 277 | |
| 274 local conn, handler; | 278 local conn, handler; |
| 275 if connect_host.proto == "IPv4" then | 279 if connect_host.proto == "IPv4" then |
| 276 conn, handler = socket.tcp(); | 280 conn, handler = socket.tcp(); |
| 277 else | 281 else |
| 278 conn, handler = socket.tcp6(); | 282 conn, handler = socket.tcp6(); |
