cvs: pecl /apc apc_cache.c apc_optimizer.c

From: Date: Fri, 27 Jun 2003 00:07:26 +0000
Subject: cvs: pecl /apc apc_cache.c apc_optimizer.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-330@lists.php.net to get a copy of this message
rasmus Thu Jun 26 20:07:26 2003 EDT Modified files: /pecl/apc apc_cache.c apc_optimizer.c Log: Eliminate the stat() on the primary script since Apache has already done it. And fix a warning in the optimizer. Index: pecl/apc/apc_cache.c diff -u pecl/apc/apc_cache.c:3.48 pecl/apc/apc_cache.c:3.49 --- pecl/apc/apc_cache.c:3.48 Thu Jun 26 11:19:38 2003 +++ pecl/apc/apc_cache.c Thu Jun 26 20:07:26 2003 @@ -14,11 +14,12 @@ +----------------------------------------------------------------------+ */ -/* $Id: apc_cache.c,v 3.48 2003/06/26 15:19:38 gschlossnagle Exp $ */ +/* $Id: apc_cache.c,v 3.49 2003/06/27 00:07:26 rasmus Exp $ */ #include "apc_cache.h" #include "apc_sem.h" #include "apc_sma.h" +#include "SAPI.h" /* TODO: rehash when load factor exceeds threshold */ @@ -332,7 +333,10 @@ if (!filename) return 0; - if (stat(filename, &buf) != 0 && + if(!strcmp(SG(request_info).path_translated, filename)) { + buf = *sapi_get_stat(); /* Apache has already done this stat() for us */ + } + else if (stat(filename, &buf) != 0 && apc_stat_paths(filename, include_path, &buf) != 0) { return 0; Index: pecl/apc/apc_optimizer.c diff -u pecl/apc/apc_optimizer.c:3.16 pecl/apc/apc_optimizer.c:3.17 --- pecl/apc/apc_optimizer.c:3.16 Thu Jun 26 11:12:29 2003 +++ pecl/apc/apc_optimizer.c Thu Jun 26 20:07:26 2003 @@ -603,7 +603,7 @@ int tmp_var_result; if(!is_constant_op(ops + i)) { - return 0; + return (Pair *)0; } tmp_var_result = ops[i].result.u.var; for( j = i+1; j < num_ops; j++) { @@ -616,6 +616,7 @@ return cons(i, cons(j, 0)); } } + return (Pair *)0; } static Pair* peephole_add_string(zend_op* ops, int i, int num_ops)

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