From ea5e888d9df000dc26ae6e1d64eeeeb8535d7d8c Mon Sep 17 00:00:00 2001 From: Xuefer Date: Sun, 10 Dec 2006 04:15:53 +0000 Subject: [PATCH] cacher: fix stat and skip user stream git-svn-id: svn://svn.lighttpd.net/xcache/trunk@317 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- xcache.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xcache.c b/xcache.c index 5c63d10..e8d682d 100644 --- a/xcache.c +++ b/xcache.c @@ -704,13 +704,13 @@ static int xc_stat(const char *filename, const char *include_path, struct stat * } if (VCWD_STAT(filepath, pbuf) == 0) { free_alloca(paths); - return FAILURE; + return SUCCESS; } } free_alloca(paths); - return SUCCESS; + return FAILURE; } /* }}} */ @@ -749,6 +749,10 @@ static int xc_entry_init_key_php(xc_entry_t *xce, char *filename, char *opened_p return FAILURE; } + if (strstr(filename, "://") != NULL) { + return FAILURE; + } + php = xce->data.php; if (XG(stat)) { @@ -1146,6 +1150,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / assert(xc_initized); + TRACE("type = %d\n", h->type); if (!XG(cacher)) { op_array = origin_compile_file(h, type TSRMLS_CC); #ifdef HAVE_XCACHE_OPTIMIZER @@ -1160,6 +1165,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / filename = h->opened_path ? h->opened_path : h->filename; xce.data.php = &php; if (xc_entry_init_key_php(&xce, filename, opened_path_buffer TSRMLS_CC) != SUCCESS) { + TRACE("failed to init key for %s", filename); return origin_compile_file(h, type TSRMLS_CC); } cache = xce.cache;