aboutsummaryrefslogtreecommitdiffstats
path: root/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'ls.c')
-rw-r--r--ls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ls.c b/ls.c
index 61aed70..2ce7887 100644
--- a/ls.c
+++ b/ls.c
@@ -458,8 +458,8 @@ get_dir(struct REQUEST *req, char *filename)
}
if (this) {
/* check mtime and cache entry age */
- if (this->mtime < req->bst.st_mtime ||
- now - this->add > MAX_CACHE_AGE) {
+ if (now - this->add > MAX_CACHE_AGE ||
+ 0 != strcmp(this->mtime, req->mtime)) {
free_dir(this);
this = NULL;
}
@@ -476,10 +476,10 @@ get_dir(struct REQUEST *req, char *filename)
dirs = this;
DO_UNLOCK(lock_dircache);
- strcpy(this->path,filename);
- this->mtime = req->bst.st_mtime;
- this->add = now;
- this->html = ls(now,req->hostname,filename,req->path,&(this->length));
+ strcpy(this->path, filename);
+ strcpy(this->mtime, req->mtime);
+ this->add = now;
+ this->html = ls(now,req->hostname,filename,req->path,&(this->length));
DO_LOCK(this->lock_reading);
this->reading = 0;