From ffe818505c01faf2e5677f28eddf01203618ea72 Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 16 Apr 2012 15:13:44 +0000 Subject: Attempt to fix lastposttime out-of-sync when system was busy. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5665 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/board.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index ca016a78..b9c69417 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/mbbsd/board.c @@ -837,21 +837,21 @@ check_newpost(boardstat_t * ptr) ptr->myattr & (NBRD_LINE | NBRD_FOLDER)) return 0; - if (B_TOTAL(ptr) == 0) - { - setbtotal(ptr->bid); - setbottomtotal(ptr->bid); - } + if (B_TOTAL(ptr) == 0) { + setbtotal(ptr->bid); + setbottomtotal(ptr->bid); + } if (B_TOTAL(ptr) == 0) return 0; - ftime = B_LASTPOSTTIME(ptr); - /* 有些 util, 尤其是 innbbsd, 會用到比較新的 time stamp, - * 只要不太誇張就 ok */ - if (ftime > now + 10) - ftime = B_LASTPOSTTIME(ptr) = now - 1; + // Note: 以前這裡有 if(ftime > now [+10]) 就重設 ftime 的 code; + // 但實際的狀況是那樣產生的 lastposttime 會與看板內的文章不同, + // 造成未讀符號永遠不會消失。 又,在這邊的 now 其實是非同步的, + // 所以若有人在進入這裡面卡很久(ex, system overload)那就會非常容易 + // 變成 ftime > now. + ftime = B_LASTPOSTTIME(ptr); - if ( brc_unread_time(ptr->bid, ftime, 0) ) + if (brc_unread_time(ptr->bid, ftime, 0)) ptr->myattr |= NBRD_UNREAD; return 1; -- cgit v1.2.3