cvs: pecl /apc apc_cache.c apc_compile.c

From: Date: Sat, 25 Aug 2007 13:09:13 +0000
Subject: cvs: pecl /apc apc_cache.c apc_compile.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-8477@lists.php.net to get a copy of this message
gopalv Sat Aug 25 13:09:13 2007 UTC Modified files: /pecl/apc apc_cache.c apc_compile.c Log: Make APC nostat canonicalize includes from the include_path http://cvs.php.net/viewvc.cgi/pecl/apc/apc_cache.c?r1=3.142&r2=3.143&diff_format=u Index: pecl/apc/apc_cache.c diff -u pecl/apc/apc_cache.c:3.142 pecl/apc/apc_cache.c:3.143 --- pecl/apc/apc_cache.c:3.142 Tue Jun 5 10:59:30 2007 +++ pecl/apc/apc_cache.c Sat Aug 25 13:09:13 2007 @@ -28,7 +28,7 @@ */ -/* $Id: apc_cache.c,v 3.142 2007/06/05 10:59:30 gopalv Exp $ */ +/* $Id: apc_cache.c,v 3.143 2007/08/25 13:09:13 gopalv Exp $ */ #include "apc_cache.h" #include "apc_lock.h" @@ -716,11 +716,11 @@ time_t t TSRMLS_DC) { - static char canon_path[MAXPATHLEN]; + static char canon_path[MAXPATHLEN]; /* TODO: TSRM */ struct stat *tmp_buf=NULL; struct apc_fileinfo_t fileinfo = { {0}, }; int len; - + assert(key != NULL); if (!filename || !SG(request_info).path_translated) { @@ -738,10 +738,16 @@ key->mtime = t; key->type = APC_CACHE_KEY_FPFILE; } else { - if(!realpath(filename, canon_path)) { - fprintf(stderr, "realpath failed to canonicalize %s - bailing\n", filename); + if (apc_search_paths(filename, include_path, &fileinfo) != 0) { + apc_wprint("apc failed to locate %s - bailing", filename); return 0; } + + if(!realpath(fileinfo.fullpath, canon_path)) { + apc_wprint("realpath failed to canonicalize %s - bailing", filename); + return 0; + } + key->data.fpfile.fullpath = canon_path; key->data.fpfile.fullpath_len = strlen(canon_path); key->mtime = t; http://cvs.php.net/viewvc.cgi/pecl/apc/apc_compile.c?r1=3.86&r2=3.87&diff_format=u Index: pecl/apc/apc_compile.c diff -u pecl/apc/apc_compile.c:3.86 pecl/apc/apc_compile.c:3.87 --- pecl/apc/apc_compile.c:3.86 Sun Apr 29 18:43:49 2007 +++ pecl/apc/apc_compile.c Sat Aug 25 13:09:13 2007 @@ -28,7 +28,7 @@ */ -/* $Id: apc_compile.c,v 3.86 2007/04/29 18:43:49 edink Exp $ */ +/* $Id: apc_compile.c,v 3.87 2007/08/25 13:09:13 gopalv Exp $ */ #include "apc_compile.h" #include "apc_globals.h" @@ -1268,9 +1268,8 @@ /* constant includes */ if(!IS_ABSOLUTE_PATH(Z_STRVAL_P(&zo->op1.u.constant),Z_STRLEN_P(&zo->op1.u.constant))) { if (apc_search_paths(Z_STRVAL_P(&zo->op1.u.constant), PG(include_path), &fileinfo) == 0) { - if((IS_ABSOLUTE_PATH(fileinfo.fullpath, strlen(fileinfo.fullpath)) && (fullpath = fileinfo.fullpath)) - || (fullpath = realpath(fileinfo.fullpath, canon_path))) { - /* is either an absolute path or it goes through a realpath() */ + if((fullpath = realpath(fileinfo.fullpath, canon_path))) { + /* everything has to go through a realpath() */ zend_op *dzo = &(dst->opcodes[i]); deallocate(dzo->op1.u.constant.value.str.val); dzo->op1.u.constant.value.str.len = strlen(fullpath);

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