Update of /cvsroot/aolserver/aolserver/nsd
In directory vz-cvs-4.sog:/tmp/cvs-serv24231/nsd
Modified Files:
nsd.h server.c fastpath.c
Log Message:
apply patch from John Caruso to avoid fastpath
caching a file that has been modified too recently and possibly
colliding inodes
Index: fastpath.c
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nsd/fastpath.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** fastpath.c 18 Aug 2011 09:24:59 -0000 1.27
--- fastpath.c 7 Oct 2011 17:06:32 -0000 1.28
***************
*** 503,509 ****
if (servPtr->fastpath.cache == NULL
! || stPtr->st_size > servPtr->fastpath.cachemaxentry) {
/*
! * Caching is disabled or the entry is too large for the cache
* so just open, mmap, and send the content directly.
*/
--- 503,511 ----
if (servPtr->fastpath.cache == NULL
! || stPtr->st_size > servPtr->fastpath.cachemaxentry
! || (time(NULL) - stPtr->st_ctime) < servPtr->fastpath.cacheminage ) {
/*
! * Caching is disabled, the entry is too large for the cache,
! * or the inode was changed too recently to be cached safely,
* so just open, mmap, and send the content directly.
*/
Index: nsd.h
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nsd/nsd.h,v
retrieving revision 1.123
retrieving revision 1.124
diff -C2 -d -r1.123 -r1.124
*** nsd.h 28 Sep 2011 05:50:47 -0000 1.123
--- nsd.h 7 Oct 2011 17:06:30 -0000 1.124
***************
*** 655,658 ****
--- 655,659 ----
bool mmap;
int cachemaxentry;
+ int cacheminage;
Ns_UrlToFileProc *url2file;
Ns_Cache *cache;
Index: server.c
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nsd/server.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** server.c 5 Jul 2011 18:37:47 -0000 1.49
--- server.c 7 Oct 2011 17:06:31 -0000 1.50
***************
*** 393,396 ****
--- 393,400 ----
}
servPtr->fastpath.cachemaxentry = i;
+ if (!Ns_ConfigGetInt(path, "cacheminage", &i) || i < 0) {
+ i = 1;
+ }
+ servPtr->fastpath.cacheminage = i;
servPtr->fastpath.cache = NsFastpathCache(server, n);
}
|