From 959c38eb56c1325e4d815cb740a85301edfc4d4a Mon Sep 17 00:00:00 2001 From: ptt Date: Mon, 13 May 2002 09:16:44 +0000 Subject: anti robot test git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@165 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mbbsd') 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 #include #include @@ -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++]; } -- cgit v1.2.3