From ff69ea35cd01fd2c530d59fc5308f9ef542314bc Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Windows 11)" <rob@synchro.net> Date: Sat, 24 Feb 2024 17:31:49 -0800 Subject: [PATCH] Telnet commands haven't been sent to node-spy ring buffers for years now ... so no need to parse/strip them here. --- src/sbbs3/ctrl/SpyFormUnit.cpp | 21 ++------------------- src/sbbs3/ctrl/SpyFormUnit.h | 2 +- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/sbbs3/ctrl/SpyFormUnit.cpp b/src/sbbs3/ctrl/SpyFormUnit.cpp index ac810c2a50..5db8435caf 100644 --- a/src/sbbs3/ctrl/SpyFormUnit.cpp +++ b/src/sbbs3/ctrl/SpyFormUnit.cpp @@ -24,7 +24,6 @@ #include "MainFormUnit.h" #include "SpyFormUnit.h" -#include "telnet.h" #include "str_util.h" #define SPYBUF_LEN 100000 @@ -54,7 +53,7 @@ __fastcall TSpyForm::~TSpyForm() delete Terminal; } //--------------------------------------------------------------------------- -int __fastcall TSpyForm::strip_telnet(uchar *buf, int len) +int __fastcall TSpyForm::ParseOutput(uchar *buf, int len) { int i; int telnet_cmd=0; @@ -65,22 +64,6 @@ int __fastcall TSpyForm::strip_telnet(uchar *buf, int len) Terminal->Clear(); continue; } - if(buf[i]==TELNET_IAC || telnet_cmd) { - if(telnet_cmd==1 && buf[i]==TELNET_IAC) { - telnet_cmd=0; /* escape IAC */ - continue; - } - if(telnet_cmd==1 && buf[i]<TELNET_WILL) { - telnet_cmd=0; /* single byte command */ - continue; - } - if(telnet_cmd>=2) { - telnet_cmd=0; /* two byte command */ - continue; - } - telnet_cmd++; - continue; - } buf[newlen++]=buf[i]; } return(newlen); @@ -100,7 +83,7 @@ void __fastcall TSpyForm::SpyTimerTick(TObject *Sender) if(fdate(TerminalIniFile.c_str()) > terminal_fdate) ReadTerminalIniFile(); } - rd=strip_telnet(buf,rd); + rd=ParseOutput(buf,rd); buf[rd] = 0; if(utf8) utf8_to_cp437_inplace(buf); diff --git a/src/sbbs3/ctrl/SpyFormUnit.h b/src/sbbs3/ctrl/SpyFormUnit.h index a6fe5a772c..ac4cae4593 100644 --- a/src/sbbs3/ctrl/SpyFormUnit.h +++ b/src/sbbs3/ctrl/SpyFormUnit.h @@ -60,7 +60,7 @@ __published: // IDE-managed Components void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y); private: // User declarations - int __fastcall strip_telnet(uchar *buf, int len); + int __fastcall ParseOutput(uchar *buf, int len); time_t terminal_fdate; void __fastcall ReadTerminalIniFile(); bool utf8; -- GitLab