...
 
Commits (2)
  • Rob Swindell's avatar
    Don't assume the BinkP VER message contains 3-space-delimited fields. · d1566e7d
    Rob Swindell authored
    According to both FTS-1026 and FSP-1024, the "mailer version" portion of this
    msg may contain spaces. Some mailers (e.g. Internet Rex), provide their version
    information with spaces, e.g. "Internet Rex 2.67 beta 1a OS/2 (binkp/1.1)",
    which also include a non-conformant protocol version indicator:
     " (binkp/1.1)" instead of " binkp/1.1".
    Additionally, only require that "binkp/" exist in the string, to find and
    parse the protocol version number, which is apparently critical to the proper
    operation of the protocol. This should resolve issue #185 reported by altere.
    
    I'm also storing the entire VER response in the binkp.remote_ver property and
    this will break the older Mystic/BinkP work-arounds in binkit.js. I dont' think
    we really need those workarounds any longer however. We'll soon see I guess.
    d1566e7d
  • Rob Swindell's avatar
    10d7a690
......@@ -1208,28 +1208,13 @@ BinkP.prototype.recvFrame = function(timeout)
}
break;
case 'VER':
log(LOG_INFO, "Peer version: " + args.slice(1).join(' '));
tmp = ret.data.split(/ /);
if (tmp.length >= 3) {
this.remote_ver = tmp[1];
if (tmp[2].substr(0, 6) === 'binkp/') {
ver = tmp[2].substr(6).split(/\./);
if (ver.length >= 2) {
tmp = parseInt(ver[0], 10);
switch(tmp) {
case NaN:
break;
case 1:
if (parseInt(ver[1], 10) > 0)
this.ver1_1 = true;
break;
default:
if (tmp > 1)
this.ver1_1 = true;
break;
}
}
}
this.remote_ver = args.slice(1).join(' ');
log(LOG_INFO, "Peer version: " + this.remote_ver);
var binkp_ver = this.remote_ver.indexOf('binkp/');
if(binkp_ver >= 0) {
binkp_ver = parseFloat(this.remote_ver.substr(binkp_ver + 6));
log(LOG_DEBUG, "Parsed BinkP version: " + binkp_ver);
this.ver_1_1 = binkp_ver >= 1.1;
}
break;
case 'ZYZ':
......