summaryrefslogtreecommitdiffstats
path: root/mbbsd/telnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/telnet.c')
-rw-r--r--mbbsd/telnet.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c
index 4e7daf53..7cf1fee5 100644
--- a/mbbsd/telnet.c
+++ b/mbbsd/telnet.c
@@ -43,72 +43,6 @@ telnet_init(int do_init_cmd)
telnet_ctx_send_init_cmds(ctx);
}
-#if defined(DBCSAWARE)
-ssize_t
-dbcs_detect_evil_repeats(unsigned char *buf, ssize_t l)
-{
- // determine DBCS repeats by evil clients (ref: io.c)
- if (l == 2)
- {
- // XXX l=2 is dangerous. hope we are not in telnet IAC state...
- // BS: \b
- // BS2: \x7f
- // DEL2: Ctrl('D') (KKMan3 also treats Ctrl('D') as DBCS DEL)
- if (buf[0] != buf[1])
- return l;
-
- // Note: BS/DEL behavior on different clients:
- // screen/telnet:BS=0x7F, DEL=^[3~
- // PCMan2004: BS=0x7F, DEL=^[3~
- // KKMan3: BS=0x1b, DEL=0x7F
- // WinXP telnet: BS=0x1b, DEL=0x7F
- if (buf[0] == '\b' ||
- buf[0] == '\x7f' ||
- buf[0] == Ctrl('D'))
- return l-1;
- }
- else if (l == 6)
- {
- // RIGHT: ESC_CHR "OC" or ESC_CHR "[C"
- // LEFT: ESC_CHR "OD" or ESC_CHR "[D"
- if (buf[2] != 'C' && buf[2] != 'D')
- return l;
-
- if ( buf[0] == ESC_CHR &&
- (buf[1] == '[' || buf[1] == 'O') &&
- buf[0] == buf[3] &&
- buf[1] == buf[4] &&
- buf[2] == buf[5])
- return l-3;
- }
- else if (l == 8)
- {
- // RIGHT: ESC_CHR "[OC"
- // LEFT: ESC_CHR "[OD"
- // DEL: ESC_STR "[3~" // vt220
- if (buf[2] != '3' && buf[2] != 'O')
- return l;
-
- if (buf[0] != ESC_CHR ||
- buf[1] != '[' ||
- buf[4] != buf[0] ||
- buf[5] != buf[1] ||
- buf[6] != buf[2] ||
- buf[7] != buf[3])
- return l;
-
- if (buf[2] == '3' &&
- buf[3] == '~')
- return l-4;
-
- if ( buf[2] == 'O' &&
- (buf[3] == 'C' || buf[3] == 'D') )
- return l-4;
- }
- return l;
-}
-#endif
-
/* tty_read
* read from tty, process telnet commands if raw connection.
* return: >0 = length, <=0 means read more, abort/eof is automatically processed.
@@ -122,11 +56,6 @@ tty_read(unsigned char *buf, size_t max)
if(l == 0 || (l < 0 && !(errno == EINTR || errno == EAGAIN)))
abort_bbs(0);
-#if defined(DBCSAWARE)
- if (ISDBCSAWARE() && HasUserFlag(UF_DBCS_DROP_REPEAT))
- l = dbcs_detect_evil_repeats(buf, l);
-#endif
-
if(!raw_connection || l <= 0)
return l;