Browse Source

fix for win32

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.0@160 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.0
Xuefer 15 years ago
parent
commit
430bccfc85
  1. 15
      xcache.c
  2. 2
      xcache.h

15
xcache.c

@ -503,7 +503,7 @@ static inline xc_hash_value_t xc_entry_hash_php(xc_entry_t *xce) /* {{{ */
#endif
}
/* }}} */
static int xc_entry_init_key_php(xc_entry_t *xce, char *filename TSRMLS_DC) /* {{{ */
static int xc_entry_init_key_php(xc_entry_t *xce, char *filename, char *opened_path_buffer TSRMLS_DC) /* {{{ */
{
struct stat buf, *pbuf;
xc_hash_value_t hv;
@ -540,6 +540,14 @@ static int xc_entry_init_key_php(xc_entry_t *xce, char *filename TSRMLS_DC) /* {
return 0;
}
#ifndef HAVE_INODE
/* hash on filename, let's expand it to real path */
filename = expand_filepath(filename, opened_path_buffer TSRMLS_CC);
if (filename == NULL) {
return 0;
}
#endif
UNISW(NOTHING, xce->name_type = IS_STRING;)
xce->name.str.val = filename;
xce->name.str.len = strlen(filename);
@ -573,6 +581,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
zend_bool clogged = 0;
zend_bool catched = 0;
char *filename;
char opened_path_buffer[MAXPATHLEN];
if (!xc_initized) {
assert(0);
@ -597,7 +606,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 TSRMLS_CC)) {
if (!xc_entry_init_key_php(&xce, filename, opened_path_buffer TSRMLS_CC)) {
return origin_compile_file(h, type TSRMLS_CC);
}
cache = xce.cache;
@ -669,10 +678,12 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
}
filename = h->opened_path ? h->opened_path : h->filename;
#ifdef HAVE_INODE
if (xce.name.str.val != filename) {
xce.name.str.val = filename;
xce.name.str.len = strlen(filename);
}
#endif
#ifdef HAVE_XCACHE_OPTIMIZER
if (XG(optimizer)) {

2
xcache.h

@ -1,7 +1,7 @@
#ifndef __XCACHE_H
#define __XCACHE_H
#define XCACHE_NAME "XCache"
#define XCACHE_VERSION "1.0.1"
#define XCACHE_VERSION "1.0.1-r1"
#define XCACHE_AUTHOR "mOo"
#define XCACHE_COPYRIGHT "Copyright (c) 2005-2006"
#define XCACHE_URL "http://xcache.lighttpd.net"

Loading…
Cancel
Save