summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-08 05:33:24 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-08 05:33:24 +0800
commite083479d8a0ae78b774767e9774d52da6f8f37ec (patch)
tree0da4ae3b7480b3ee2d344be6455576b15734204f
parent3b3a2ac7f168b4f1a14caa4c93da4b9f1e4d067b (diff)
downloadpttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.tar
pttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.tar.gz
pttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.tar.bz2
pttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.tar.lz
pttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.tar.xz
pttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.tar.zst
pttbbs-e083479d8a0ae78b774767e9774d52da6f8f37ec.zip
push_bottom
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1719 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h1
-rw-r--r--mbbsd/cache.c14
-rw-r--r--mbbsd/read.c3
3 files changed, 14 insertions, 4 deletions
diff --git a/include/proto.h b/include/proto.h
index 31c068bc..138bfd13 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -138,6 +138,7 @@ void remove_from_uhash(int n);
void add_to_uhash(int n, char *id);
int setumoney(int uid, int money);
int getbtotal(int bid);
+int getbottomtotal(int bid);
userinfo_t *search_ulist_pid(int pid);
userinfo_t *search_ulist_userid(char *userid);
int moneyof(int uid);
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 288c38cf..e76110b8 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -520,12 +520,20 @@ touchdircache(int bid)
void
load_fileheader_cache(int bid, char *direct)
{
- int num = getbtotal(bid);
- int n = num - DIRCACHESIZE + 1;
+ int num = getbtotal(bid), n_bottom = getbottomtotal(bid);
+ int n = num - DIRCACHESIZE + n_bottom + 1;
+ int dirsize = DIRCACHESIZE-n_bottom;
if (SHM->Bbusystate != 1 && COMMON_TIME - SHM->busystate_b[bid - 1] >= 10) {
SHM->busystate_b[bid - 1] = COMMON_TIME;
+ if(n_bottom)
+ {
+ char path[256];
+ setbfile(path, currboard, ".BOTTOM");
+ get_records(path, &SHM->dircache[bid - 1][dirsize],
+ sizeof(fileheader_t), 1, n_bottom);
+ }
get_records(direct, SHM->dircache[bid - 1],
- sizeof(fileheader_t), n < 1 ? 1 : n, DIRCACHESIZE);
+ sizeof(fileheader_t), n < 1 ? 1 : n, dirsize);
SHM->busystate_b[bid - 1] = 0;
} else {
safe_sleep(1);
diff --git a/mbbsd/read.c b/mbbsd/read.c
index fb3e15d2..52f329ff 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -794,7 +794,7 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
{
keeploc_t *locmem = NULL;
int recbase = 0, mode, ch;
- int num = 0, entries = 0;
+ int num = 0, entries = 0, n_bottom=0;
int i;
int jump = 0;
char genbuf[4];
@@ -822,6 +822,7 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
setbottomtotal(currbid);
last_line = get_num_records(currdirect, FHSZ);
}
+ last_line += (n_bottom = getbottomtotal(currbid));
}
else
last_line = get_num_records(currdirect, FHSZ);