diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-08-04 14:58:02 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-08-04 14:58:02 +0800 |
commit | 2958f2d55afa6a7128a9515e0a91083bca7d6975 (patch) | |
tree | 95ad3a144916924d0a2ce6e361f7ab3c7b718df7 | |
parent | 5385d76f7f5f8ab7af9264096a4ec2525fd0c8f8 (diff) | |
download | pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.tar pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.tar.gz pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.tar.bz2 pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.tar.lz pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.tar.xz pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.tar.zst pttbbs-2958f2d55afa6a7128a9515e0a91083bca7d6975.zip |
add SKIP_TELNET_CONTROL_SIGNAL
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1082 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/io.c | 18 | ||||
-rw-r--r-- | sample/pttbbs.conf | 4 |
2 files changed, 16 insertions, 6 deletions
@@ -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 修改您的前進站畫面)" |