diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-04-08 22:20:46 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-04-08 22:20:46 +0800 |
commit | 51ad46affe5c1ca50ca3e2347beb2f4904f6a72c (patch) | |
tree | 94290e2dd801be67306030701c4e18f106a9f580 | |
parent | c7630e7cdb0bde70327f4b03a8def2656c5dcc33 (diff) | |
download | pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.tar pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.tar.gz pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.tar.bz2 pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.tar.lz pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.tar.xz pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.tar.zst pttbbs-51ad46affe5c1ca50ca3e2347beb2f4904f6a72c.zip |
prevent query too frequently by sleeping after each query.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3328 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/talk.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 3fb17ac1..1ecac089 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -460,6 +460,7 @@ my_query(const char *uident) {MSG_BIG_BOY, MSG_BIG_GIRL, MSG_LITTLE_BOY, MSG_LITTLE_GIRL, MSG_MAN, MSG_WOMAN, MSG_PLANT, MSG_MIME}; + static time_t last_query; STATINC(STAT_QUERY); if ((tuid = getuser(uident, &muser))) { @@ -518,6 +519,11 @@ my_query(const char *uident) } else pressanykey(); + if(now-last_query<1) + sleep(2); + else if(now-last_query<2) + sleep(1); + last_query=now; return FULLUPDATE; } return DONOTHING; |