Comparison

plugins/mod_s2s/s2sout.lib.lua @ 5703:ea00fc524b95

mod_s2s/s2sout.lib: Remove unused variables and imports
author Matthew Wild <mwild1@gmail.com>
date Tue, 18 Jun 2013 12:14:46 +0100
parent 5702:a56691e3c7d1
child 5776:bd0ff8ae98a8
child 6015:8fead005ee60
comparison
equal deleted inserted replaced
5702:a56691e3c7d1 5703:ea00fc524b95
16 local rfc6724_dest = require "util.rfc6724".destination; 16 local rfc6724_dest = require "util.rfc6724".destination;
17 local socket = require "socket"; 17 local socket = require "socket";
18 local adns = require "net.adns"; 18 local adns = require "net.adns";
19 local dns = require "net.dns"; 19 local dns = require "net.dns";
20 local t_insert, t_sort, ipairs = table.insert, table.sort, ipairs; 20 local t_insert, t_sort, ipairs = table.insert, table.sort, ipairs;
21 local st = require "util.stanza";
22 local local_addresses = require "util.net".local_addresses; 21 local local_addresses = require "util.net".local_addresses;
23 22
24 local s2s_destroy_session = require "core.s2smanager".destroy_session; 23 local s2s_destroy_session = require "core.s2smanager".destroy_session;
25 24
26 local log = module._log; 25 local log = module._log;
72 end 71 end
73 end 72 end
74 end 73 end
75 74
76 function s2sout.attempt_connection(host_session, err) 75 function s2sout.attempt_connection(host_session, err)
77 local from_host, to_host = host_session.from_host, host_session.to_host; 76 local to_host = host_session.to_host;
78 local connect_host, connect_port = to_host and idna_to_ascii(to_host), 5269; 77 local connect_host, connect_port = to_host and idna_to_ascii(to_host), 5269;
79 78
80 if not connect_host then 79 if not connect_host then
81 return false; 80 return false;
82 end 81 end
265 return true; 264 return true;
266 end 265 end
267 266
268 function s2sout.make_connect(host_session, connect_host, connect_port) 267 function s2sout.make_connect(host_session, connect_host, 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); 268 (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 269
271
272 local from_host, to_host = host_session.from_host, host_session.to_host;
273
274 -- Reset secure flag in case this is another 270 -- Reset secure flag in case this is another
275 -- connection attempt after a failed STARTTLS 271 -- connection attempt after a failed STARTTLS
276 host_session.secure = nil; 272 host_session.secure = nil;
277 273
278 local conn, handler; 274 local conn, handler;