Skip to content
Snippets Groups Projects
Commit 06a5aa08 authored by deuce's avatar deuce
Browse files

Add support for the per-link "Host" keyword in binkit.ini, and allow the

host to be passed to the connect() method of the BinkP object.
parent b3899c18
No related branches found
No related tags found
No related merge requests found
......@@ -488,6 +488,7 @@ function callout(addr, scfg, ftnd, semaphores, locks)
var myaddr = FIDO.parse_addr(system.fido_addr_list[0], 1, 'fidonet');
var bp = new BinkP('BinkIT/'+("$Revision$".split(' ')[1]), undefined, rx_callback, tx_callback);
var port;
var host;
var f;
var success = false;
var src_addr;
......@@ -506,6 +507,7 @@ function callout(addr, scfg, ftnd, semaphores, locks)
if (bp.cb_data.binkitcfg.node[addr] !== undefined) {
bp.cb_data.binkitpw = bp.cb_data.binkitcfg.node[addr].pass;
port = bp.cb_data.binkitcfg.node[addr].port;
host = bp.cb_data.binkitcfg.node[addr].host;
bp.require_md5 = !(bp.cb_data.binkitcfg.node[addr].nomd5);
bp.require_crypt = !(bp.cb_data.binkitcfg.node[addr].nocrypt);
}
......@@ -576,7 +578,7 @@ function callout(addr, scfg, ftnd, semaphores, locks)
});
// We won't add files until the auth finishes...
success = bp.connect(addr, bp.cb_data.binkitpw, callout_auth_cb, port);
success = bp.connect(addr, bp.cb_data.binkitpw, callout_auth_cb, port, host);
callout_done(bp, semaphores);
}
......
......@@ -366,7 +366,7 @@ BinkP.prototype.parseArgs = function(data)
* parameter string send with the M_OK message... hopefully either "secure"
* or "non-secure"
*/
BinkP.prototype.connect = function(addr, password, auth_cb, port)
BinkP.prototype.connect = function(addr, password, auth_cb, port, inet_host)
{
var pkt;
var i;
......@@ -385,13 +385,15 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port)
this.require_md5 = false;
if (port === undefined)
port = 24554;
if (inet_host === undefined)
inet_host = addr.inet_host;
if (this.sock === undefined)
this.sock = new Socket(SOCK_STREAM, "binkp");
if(!this.sock.connect(addr.inet_host, port)) {
if(!this.sock.connect(inet_host, port)) {
this.sock = undefined;
log(LOG_INFO, "Connection to "+addr.inet_host+":"+port+" failed.");
log(LOG_INFO, "Connection to "+inet_host+":"+port+" failed.");
return false;
}
......
......@@ -330,6 +330,7 @@ function BinkITCfg()
this.node[sec].norypt = f.iniGetValue(section, 'AllowUnencrypted');
this.node[sec].port = f.iniGetValue(section, 'Port');
this.node[sec].src = f.iniGetValue(section, 'SourceAddress');
this.node[sec].host = f.iniGetValue(section, 'Host');
if (this.node[sec].nomd5 == undefined)
this.node[sec].nomd5 = false;
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment