summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 17:16:44 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 17:16:44 +0800
commit959c38eb56c1325e4d815cb740a85301edfc4d4a (patch)
treef3569e3816e61b2546ac3d03d7b4dc634ed5900a /mbbsd/io.c
parent8d2eccd564b1a85bbc26153a3011a78797d2ae12 (diff)
downloadpttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.tar
pttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.tar.gz
pttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.tar.bz2
pttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.tar.lz
pttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.tar.xz
pttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.tar.zst
pttbbs-959c38eb56c1325e4d815cb740a85301edfc4d4a.zip
anti robot test
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@165 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index c969be8e..d2219b64 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.10 2002/05/13 03:20:04 ptt Exp $ */
+/* $Id: io.c,v 1.11 2002/05/13 09:16:44 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -127,7 +127,7 @@ int watermode = -1, wmofo = -1;
static int dogetch() {
int len;
- static int count=0;
+ static time_t anti_robot=0;
if(ibufsize <= icurrchar) {
if(flushf)
@@ -177,13 +177,15 @@ static int dogetch() {
{
now= time(0);
if(now-currutmp->lastact<3)
- count=0;
+ anti_robot=now;
+ else if(!anti_robot || now-anti_robot < IDLE_TIMEOUT)
+ {
+ currutmp->lastact = now;
+ }
else
{
- if(++count>100)
- system_abort();
+ currutmp->lastact = now - IDLE_TIMEOUT - 10;
}
- currutmp->lastact = now;
}
return inbuf[icurrchar++];
}