diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-04-08 10:27:19 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-04-08 10:27:19 +0800 |
commit | 0666dd02983c5a7ad580a29d7d6deec1cbcd80b5 (patch) | |
tree | 4ad1a26d8b3bbad4afc2a8396cbd7b8651a40b73 /mbbsd/mbbsd.c | |
parent | a0296382b6836538ae15de74b4adf96b54e8d9ad (diff) | |
download | pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.tar pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.tar.gz pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.tar.bz2 pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.tar.lz pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.tar.xz pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.tar.zst pttbbs-0666dd02983c5a7ad580a29d7d6deec1cbcd80b5.zip |
handle telnet protocol and enable NAWS (resize terminal) capability.
SKIP_TELNET_CONTROL_SIGNAL can be disabled now.
by piaip
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2690 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 41b77e43..e54c0139 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1139,6 +1139,8 @@ telnet_init(void) struct timeval to; unsigned char buf[64]; fd_set ReadSet, r; + + raw_connection = 1; FD_ZERO(&ReadSet); FD_SET(0, &ReadSet); @@ -1168,18 +1170,8 @@ telnet_init(void) bi += 3; w = GETB() << 8; w |= GETB(); h = GETB() << 8; h |= GETB(); - /* safer - // suggested by kcwu, a pity that we can't handle < 24. */ - h = MAX(24, MIN(100, h)); - w = MAX(80, MIN(200, w)); - if(buf[bi++] == IAC && buf[bi++] == SE) { - /* copied from term.c */ - t_lines = h; - t_columns = w; - scr_lns = t_lines; - b_lines = t_lines - 1; - p_lines = t_lines - 4; - } + if(buf[bi++] == IAC && buf[bi++] == SE) + term_resize(w, h); } } } |