diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-08 13:07:02 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-08 13:07:02 +0800 |
commit | 40a656b7ab01bfa140380c7a46b7f88d3ec7b961 (patch) | |
tree | cffbc8d5e4f8891dd710014aea9e25ed633fa9e7 /mbbsd/cache.c | |
parent | a6c96a359610b40fc64738b812d93340439f7f6b (diff) | |
download | pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.tar pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.tar.gz pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.tar.bz2 pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.tar.lz pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.tar.xz pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.tar.zst pttbbs-40a656b7ab01bfa140380c7a46b7f88d3ec7b961.zip |
push bottom
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1729 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r-- | mbbsd/cache.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 494f3f27..6124d361 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -518,7 +518,7 @@ touchdircache(int bid) #if DIRCACHESIZE void -load_fileheader_cache(int bid, char *direct) +load_fileheader_bottom_cache(int bid, char *direct) { int num = getbtotal(bid), n_bottom = getbottomtotal(bid); int n = num - DIRCACHESIZE + n_bottom + 1; @@ -528,15 +528,27 @@ load_fileheader_cache(int bid, char *direct) n=1; dirsize=num; } - if (SHM->Bbusystate != 1 && COMMON_TIME - SHM->busystate_b[bid - 1] >= 10) { - SHM->busystate_b[bid - 1] = COMMON_TIME; - if(n_bottom) - { + if(n_bottom) + { char path[256]; - setbfile(path, currboard, ".BOTTOM"); + sprintf(path, "%s.%s", direct, ".bottom"); get_records(path, &SHM->dircache[bid - 1][dirsize], sizeof(fileheader_t), 1, n_bottom); - } + } +} +void +load_fileheader_cache(int bid, char *direct) +{ + int num = getbtotal(bid), n_bottom = getbottomtotal(bid); + int n = num - DIRCACHESIZE + n_bottom + 1; + int dirsize = DIRCACHESIZE-n_bottom; + if (n<1) + { + n=1; + dirsize=num; + } + if (SHM->Bbusystate != 1 && COMMON_TIME - SHM->busystate_b[bid - 1] >= 10) { + SHM->busystate_b[bid - 1] = COMMON_TIME; get_records(direct, SHM->dircache[bid - 1], sizeof(fileheader_t), n, dirsize); SHM->busystate_b[bid - 1] = 0; @@ -551,7 +563,7 @@ get_fileheader_cache(int bid, char *direct, fileheader_t * headers, { int ret, n, num; - num = getbtotal(bid); + num = getbtotal(bid)+getbottomtotal(bid); ret = num - recbase + 1, n = (num - DIRCACHESIZE + 1); |