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

Don't call request_telnet_opt() in rlogin mode, don't support TG_CRLF,

TG_ECHO, or TG_LINEMODE for RLogin (the protocol specifies these values).
parent ae9ebc85
No related branches found
No related tags found
No related merge requests found
......@@ -135,12 +135,14 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
sendsocket(remote_socket,(char*)buf,l);
}
/* This is required for gating to Unix telnetd */
if(mode&TG_NOTERMTYPE)
request_telnet_opt(TELNET_DONT,TELNET_TERM_TYPE, 3000); // Re-negotiation of terminal type
else {
/* This is required for gating to Unix telnetd */
if(mode&TG_NOTERMTYPE)
request_telnet_opt(TELNET_DONT,TELNET_TERM_TYPE, 3000); // Re-negotiation of terminal type
/* Text/NVT mode by default */
request_telnet_opt(TELNET_DONT,TELNET_BINARY_TX, 3000);
/* Text/NVT mode by default */
request_telnet_opt(TELNET_DONT,TELNET_BINARY_TX, 3000);
}
if(mode&(TG_PASSTHRU|TG_RLOGIN))
telnet_mode|=TELNET_MODE_GATE; // Pass-through telnet commands
......@@ -195,22 +197,24 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
else if(*buf<' ' && mode&TG_CTRLKEYS)
handle_ctrlkey(*buf, K_NONE);
gotline=false;
if(mode&TG_LINEMODE && buf[0]!='\r') {
ungetkey(buf[0]);
l=K_CHAT;
if(!(mode&TG_ECHO))
l|=K_NOECHO;
rd=getstr((char*)buf,sizeof(buf)-1,l);
if(!rd)
continue;
strcat((char*)buf,crlf);
rd+=2;
gotline=true;
}
if(mode&TG_CRLF && buf[rd-1]=='\r')
buf[rd++]='\n';
if(!gotline && mode&TG_ECHO) {
RingBufWrite(&outbuf,buf,rd);
if(!(mode&TG_RLOGIN)) {
if(mode&TG_LINEMODE && buf[0]!='\r') {
ungetkey(buf[0]);
l=K_CHAT;
if(!(mode&TG_ECHO))
l|=K_NOECHO;
rd=getstr((char*)buf,sizeof(buf)-1,l);
if(!rd)
continue;
strcat((char*)buf,crlf);
rd+=2;
gotline=true;
}
if(mode&TG_CRLF && buf[rd-1]=='\r')
buf[rd++]='\n';
if(!gotline && mode&TG_ECHO) {
RingBufWrite(&outbuf,buf,rd);
}
}
}
for(attempts=0;attempts<60 && online; attempts++) /* added retry loop here, Jan-20-2003 */
......@@ -262,8 +266,10 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
console&=~CON_RAW_IN;
telnet_mode&=~TELNET_MODE_GATE;
/* Disable Telnet Terminal Echo */
request_telnet_opt(TELNET_WILL,TELNET_ECHO);
if(!(mode&TG_RLOGIN)) {
/* Disable Telnet Terminal Echo */
request_telnet_opt(TELNET_WILL,TELNET_ECHO);
}
close_socket(remote_socket);
......
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