chuck 97/04/04 22:08:24
Modified: src/modules/proxy proxy_cache.c
Log:
Reviewed by: Chuck Murcko
Submitted by: Brian Moore <[EMAIL PROTECTED]>
Fix loopholes in cache expiry vis a vis alarms. This will be followed by
Roy's comprehensive timeout patch.
Revision Changes Path
1.11 +10 -1 apache/src/modules/proxy/proxy_cache.c
Index: proxy_cache.c
===================================================================
RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_cache.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C3 -r1.10 -r1.11
*** proxy_cache.c 1997/03/20 18:40:15 1.10
--- proxy_cache.c 1997/04/05 06:08:23 1.11
***************
*** 119,124 ****
--- 119,125 ----
if (errno != ENOENT)
{
proxy_log_uerror("stat", filename, NULL, r->server);
+ unblock_alarms();
return;
}
if (creat(filename, 0666) == -1)
***************
*** 127,138 ****
proxy_log_uerror("creat", filename, NULL, r->server);
else
lastcheck = abs(now); /* someone else got in there */
return;
}
} else
{
lastcheck = buf.st_mtime; /* save the time */
! if (now < lastcheck + every) return;
if (utime(filename, NULL) == -1)
proxy_log_uerror("utimes", filename, NULL, r->server);
}
--- 128,144 ----
proxy_log_uerror("creat", filename, NULL, r->server);
else
lastcheck = abs(now); /* someone else got in there */
+ unblock_alarms();
return;
}
} else
{
lastcheck = buf.st_mtime; /* save the time */
! if (now < lastcheck + every)
! {
! unblock_alarms();
! return;
! }
if (utime(filename, NULL) == -1)
proxy_log_uerror("utimes", filename, NULL, r->server);
}
***************
*** 143,149 ****
--- 149,158 ----
sub_garbage_coll(r,files,cachedir,"/");
if (curblocks < cachesize || curblocks + curbytes <= cachesize)
+ {
+ unblock_alarms();
return;
+ }
qsort(files->elts, files->nelts, sizeof(struct gc_ent *), gcdiff);