Skip to content
Snippets Groups Projects
Commit 013286c4 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Just parse VER using /^VER (.*) ([^ ]*?)$/

This restores the meaning of remote_ver and still has a hack for
broken, unfixable mailers that don't advertise protocol v1.1
correctly (ie: Irex)
parent bb22b358
Branches
Tags
No related merge requests found
...@@ -1022,6 +1022,8 @@ BinkP.prototype.recvFrame = function(timeout) ...@@ -1022,6 +1022,8 @@ BinkP.prototype.recvFrame = function(timeout)
var avail; var avail;
var nullpos; var nullpos;
var buf; var buf;
var m;
var binkp_ver;
// Avoid warning from syncjslint by putting this in a closure. // Avoid warning from syncjslint by putting this in a closure.
function hex2ascii(hex) function hex2ascii(hex)
...@@ -1208,11 +1210,11 @@ BinkP.prototype.recvFrame = function(timeout) ...@@ -1208,11 +1210,11 @@ BinkP.prototype.recvFrame = function(timeout)
} }
break; break;
case 'VER': case 'VER':
this.remote_ver = args.slice(1).join(' '); m = ret.data.match(/^VER (.*) ([^ ]*?)$/);
log(LOG_INFO, "Peer version: " + this.remote_ver); if (m !== null) {
var binkp_ver = this.remote_ver.indexOf('binkp/'); this.remote_ver = m[1];
if(binkp_ver >= 0) { log(LOG_INFO, "Peer version: " + this.remote_ver);
binkp_ver = parseFloat(this.remote_ver.substr(binkp_ver + 6)); binkp_ver = parseFloat(m[2].substr(m[2].indexOf('binkp/') + 6));
log(LOG_DEBUG, "Parsed BinkP version: " + binkp_ver); log(LOG_DEBUG, "Parsed BinkP version: " + binkp_ver);
this.ver_1_1 = binkp_ver >= 1.1; this.ver_1_1 = binkp_ver >= 1.1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment