summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-08-04 14:58:02 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-08-04 14:58:02 +0800
commit3e340b3ca9f3abc9ce93bcab47136acd8974dcab (patch)
tree96f54dae4501ce46805153eb82decb99c5f65558
parent9d219a8d0e3104888f2d707650eb41ec6b9ee924 (diff)
downloadpttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.tar
pttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.tar.gz
pttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.tar.bz2
pttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.tar.lz
pttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.tar.xz
pttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.tar.zst
pttbbs-3e340b3ca9f3abc9ce93bcab47136acd8974dcab.zip
add SKIP_TELNET_CONTROL_SIGNAL
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1082 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/io.c18
-rw-r--r--pttbbs/sample/pttbbs.conf4
2 files changed, 16 insertions, 6 deletions
diff --git a/pttbbs/mbbsd/io.c b/pttbbs/mbbsd/io.c
index 3b15bbe7..0a48893d 100644
--- a/pttbbs/mbbsd/io.c
+++ b/pttbbs/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/pttbbs/sample/pttbbs.conf b/pttbbs/sample/pttbbs.conf
index 8728884f..8811b6d9 100644
--- a/pttbbs/sample/pttbbs.conf
+++ b/pttbbs/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 修改您的前進站畫面)"