Commit 8072f707 authored by rswindell's avatar rswindell
Browse files

Introduced new telnet_mode bit (TELNET_MODE_OFF) used for RLogin connections

and future local login or dial-up connections.
parent 651a3c06
......@@ -910,8 +910,8 @@ void sbbs_t::send_telnet_cmd(uchar cmd, uchar opt)
{
char buf[16];
if(sys_status&SS_RLOGIN)
return; /* RLogin does not use Telnet commands */
if(telnet_mode&TELNET_MODE_OFF)
return;
if(cmd<TELNET_WILL) {
if(startup->options&BBS_OPT_DEBUG_TELNET)
......@@ -1103,6 +1103,9 @@ void input_thread(void *arg)
}
else
#endif
if(sbbs->telnet_mode&TELNET_MODE_OFF)
wrbuf=inbuf;
else
wrbuf=telnet_interpret(sbbs, inbuf, rd, telbuf, wr);
if(wr > (int)sizeof(telbuf))
lprintf("!TELBUF OVERFLOW (%d>%d)",wr,sizeof(telbuf));
......@@ -4152,6 +4155,7 @@ void DLLCALL bbs_thread(void* arg)
if(rlogin==true) {
new_node->connection="RLogin";
new_node->sys_status|=SS_RLOGIN;
new_node->telnet_mode|=TELNET_MODE_OFF; // RLogin does not use Telnet commands
}
node_threads_running++;
......
......@@ -109,6 +109,7 @@ enum {
#define TELNET_MODE_BIN_RX (1<<0)
#define TELNET_MODE_ECHO (1<<1)
#define TELNET_MODE_GATE (1<<2) // Pass-through telnet commands/responses
#define TELNET_MODE_OFF (1<<3) // This is not a Telnet connection
#ifdef DLLEXPORT
#undef DLLEXPORT
......
......@@ -796,6 +796,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
bp=wwiv_expand(buf, rd, wwiv_buf, rd, useron.misc, wwiv_flag);
if(rd>sizeof(wwiv_buf))
errorlog("WWIV_BUF OVERRUN");
} else if(telnet_mode&TELNET_MODE_OFF) {
bp=buf;
} else {
bp=telnet_expand(buf, rd, telnet_buf, rd);
if(rd>sizeof(telnet_buf))
......@@ -861,6 +863,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
bp=wwiv_expand(buf, rd, wwiv_buf, rd, useron.misc, wwiv_flag);
if(rd>sizeof(wwiv_buf))
errorlog("WWIV_BUF OVERRUN");
} else if(telnet_mode&TELNET_MODE_OFF) {
bp=buf;
} else {
bp=telnet_expand(buf, rd, telnet_buf, rd);
if(rd>sizeof(telnet_buf))
......@@ -873,7 +877,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
RingBufWrite(&outbuf, bp, rd);
}
}
#ifdef _DEBUG
#if defined(_DEBUG) && 0
if(rd>1) {
sprintf(str,"Node %d read %5d bytes from xtrn", cfg.node_num, rd);
OutputDebugString(str);
......@@ -899,7 +903,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
/* only send telnet GA every 30 seconds of no I/O */
if((loop_since_io%300)==0) {
#ifdef _DEBUG
#if defined(_DEBUG)
sprintf(str,"Node %d xtrn idle\n",cfg.node_num);
OutputDebugString(str);
#endif
......@@ -1363,9 +1367,12 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
if((rd=read(out_pipe[0],buf,rd))<1)
continue;
if(mode&EX_BIN) /* telnet IAC expansion */
bp=telnet_expand(buf, rd, output_buf, output_len);
else /* LF to CRLF expansion */
if(mode&EX_BIN) {
if(telnet_mode&TELNET_MODE_OFF)
bp=buf;
else
bp=telnet_expand(buf, rd, output_buf, output_len);
} else /* LF to CRLF expansion */
bp=lf_expand(buf, rd, output_buf, output_len);
/* Did expansion overrun the output buffer? */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment