Browse Source

cacher: improve hashing by taking file_size into acccount (stat needed of course)

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1580 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 7 years ago
parent
commit
925a2dff1e
  1. 4
      mod_cacher/xc_cacher.c

4
mod_cacher/xc_cacher.c

@ -1257,13 +1257,13 @@ static int xc_entry_php_init_key(xc_compiler_t *compiler TSRMLS_DC) /* {{{ */
/* get back to basename_begin */
++basename_begin;
basename_hash_value = HASH_STR_L(basename_begin, (uint) (filename_end - basename_begin));
basename_hash_value = HASH_STR_L(basename_begin, (uint) (filename_end - basename_begin)) ^ compiler->new_entry.file_size;
}
compiler->entry_hash.cacheid = xc_php_hcache.size > 1 ? xc_hash_fold(basename_hash_value, &xc_php_hcache) : 0;
compiler->entry_hash.entryslotid = xc_hash_fold(
compiler->new_entry.file_inode
? (xc_hash_value_t) HASH(compiler->new_entry.file_device + compiler->new_entry.file_inode)
? (xc_hash_value_t) HASH(compiler->new_entry.file_device ^ compiler->new_entry.file_inode ^ compiler->new_entry.file_size)
: basename_hash_value
, &xc_php_hentry);
}

Loading…
Cancel
Save