From 2958f2d55afa6a7128a9515e0a91083bca7d6975 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 4 Aug 2003 06:58:02 +0000 Subject: add SKIP_TELNET_CONTROL_SIGNAL git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1082 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 18 ++++++++++++------ sample/pttbbs.conf | 4 ++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mbbsd/io.c b/mbbsd/io.c index 3b15bbe7..0a48893d 100644 --- a/mbbsd/io.c +++ b/mbbsd/io.c @@ -1,4 +1,4 @@ -/* $Id: io.c,v 1.29 2003/05/07 03:35:07 bbs Exp $ */ +/* $Id$ */ #include "bbs.h" #if defined(linux) @@ -130,11 +130,17 @@ dogetch() if (i_newfd && FD_ISSET(i_newfd, &readfds)) return I_OTHERDATA; } - while ((len = read(0, inbuf, IBUFSIZE)) <= 0) { - if (len == 0 || errno != EINTR) - abort_bbs(0); - /* raise(SIGHUP); */ - } +#ifdef SKIP_TELNET_CONTROL_SIGNAL + do{ +#endif + while ((len = read(0, inbuf, IBUFSIZE)) <= 0) { + if (len == 0 || errno != EINTR) + abort_bbs(0); + /* raise(SIGHUP); */ + } +#ifdef SKIP_TELNET_CONTROL_SIGNAL + } while( inbuf[0] == -1 ); +#endif ibufsize = len; icurrchar = 0; } diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf index 8728884f..8811b6d9 100644 --- a/sample/pttbbs.conf +++ b/sample/pttbbs.conf @@ -102,6 +102,10 @@ /* 若定義, 則在文章列表的時候不同日期會標上不同顏色 */ //#define COLORDATE +/* 若定義, 則會在 read socket的時候, 則會跳過讀入時第一個 byte 是 -1 + (即 telnet 的 control packet), 可避免循環錯誤 */ +//#define SKIP_TELNET_CONTROL_SIGNAL + /* 前進站畫面 */ #define INSCREEN \ "前進站畫面 (請至 pttbbs.conf 修改您的前進站畫面)" -- cgit v1.2.3