Skip to content
Snippets Groups Projects
Commit dbbdd109 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix default mode value (should *not* be 10, i.e TG_NODESYNC|TG_CRLF)

Bug introduced in commit 49053f31

the 'mode' value was by default, undefined.
the 'timeout' value is by default, 10.

When mode value/flags was not provided on the command-line, undefined
was passed to bbs.rlogin_gate() as the 5th parameter, but the number 10
is passed as the 6th parameter (for time-out). The problem is, the first
Number parameter passed to bbs.rlogin_gate() is interpretted as the mode
value and so that becomes 10 (0x0A) which includes TG_NODESYNC thus enabling
all node messages/activity being displayed to the rlogin user and interrupting
their rlogin session (e.g. game play).

Just make the 0 the default value for mode, like we did in telgate.js.
parent f6457b46
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
require("sbbsdefs.js", 'TG_RLOGINSWAP'); require("sbbsdefs.js", 'TG_RLOGINSWAP');
var mode; var mode = 0;
var addr; var addr;
var client_name = ''; var client_name = '';
var server_name = ''; var server_name = '';
...@@ -44,7 +44,7 @@ for(var i = 0; i < argv.length; i++) { ...@@ -44,7 +44,7 @@ for(var i = 0; i < argv.length; i++) {
if(!addr) if(!addr)
addr = arg; addr = arg;
else if(!mode) else if(!mode)
mode = arg; mode = eval(arg);
else if(!client_name) else if(!client_name)
client_name = arg; client_name = arg;
else if(!server_name) else if(!server_name)
...@@ -90,7 +90,7 @@ for(var i = 0; i < argv.length; i++) { ...@@ -90,7 +90,7 @@ for(var i = 0; i < argv.length; i++) {
timeout = Number(value); timeout = Number(value);
break; break;
case 'm': case 'm':
mode = value; mode = eval(value);
break; break;
default: default:
alert(js.exec_file + ": Unrecognized option: " + arg); alert(js.exec_file + ": Unrecognized option: " + arg);
...@@ -108,7 +108,6 @@ if(!quiet) { ...@@ -108,7 +108,6 @@ if(!quiet) {
console.pause(); console.pause();
write(format(options.connecting_msg || "\x01h\x01yConnecting to \x01w%s \x01n...\r\n", remote_host)); write(format(options.connecting_msg || "\x01h\x01yConnecting to \x01w%s \x01n...\r\n", remote_host));
} }
mode = eval(mode);
var result = bbs.rlogin_gate( var result = bbs.rlogin_gate(
addr // address[:port] addr // address[:port]
,client_name || (mode & TG_RLOGINSWAP ? user.name : user.alias) ,client_name || (mode & TG_RLOGINSWAP ? user.name : user.alias)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment