cvs: pecl /apc apc_main.c

From: Date: Tue, 28 Aug 2007 23:44:42 +0000
Subject: cvs: pecl /apc apc_main.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-8479@lists.php.net to get a copy of this message
shire Tue Aug 28 23:44:42 2007 UTC Modified files: /pecl/apc apc_main.c Log: Changing cache entry mtime when stat=0 to match the last known file mtime. # Yell at me if this breaks anyone's expected functionality, or if there's a cleaner way to do this. http://cvs.php.net/viewvc.cgi/pecl/apc/apc_main.c?r1=3.100&r2=3.101&diff_format=u Index: pecl/apc/apc_main.c diff -u pecl/apc/apc_main.c:3.100 pecl/apc/apc_main.c:3.101 --- pecl/apc/apc_main.c:3.100 Sat Aug 18 08:19:14 2007 +++ pecl/apc/apc_main.c Tue Aug 28 23:44:42 2007 @@ -28,7 +28,7 @@ */ -/* $Id: apc_main.c,v 3.100 2007/08/18 08:19:14 shire Exp $ */ +/* $Id: apc_main.c,v 3.101 2007/08/28 23:44:42 shire Exp $ */ #include "apc_php.h" #include "apc_main.h" @@ -407,6 +407,26 @@ } } + /* Make sure the mtime reflects the files last known mtime in the case of fpstat==0 */ + if(key.type == APC_CACHE_KEY_FPFILE) { + apc_fileinfo_t fileinfo; + struct stat *tmp_buf = NULL; + if(!strcmp(SG(request_info).path_translated, h->filename)) { + tmp_buf = sapi_get_stat(TSRMLS_C); /* Apache has already done this stat() for us */ + } + if(tmp_buf) { + fileinfo.st_buf = *tmp_buf; + } else { + if (apc_search_paths(h->filename, PG(include_path), &fileinfo) != 0) { +#ifdef __DEBUG_APC__ + fprintf(stderr,"Stat failed %s - bailing (%s) (%d)\n",filename,SG(request_info).path_translated); +#endif + return op_array; + } + } + key.mtime = fileinfo.st_buf.st_mtime; + } + HANDLE_BLOCK_INTERRUPTIONS(); #if NONBLOCKING_LOCK_AVAILABLE

« previous php.pecl.cvs (#8479) next »