Changeset 1580 in svn


Ignore:
Timestamp:
2014-11-13T16:59:56Z (4 years ago)
Author:
Xuefer
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1572 r1580  
    12581258            ++basename_begin;
    12591259
    1260             basename_hash_value = HASH_STR_L(basename_begin, (uint) (filename_end - basename_begin));
     1260            basename_hash_value = HASH_STR_L(basename_begin, (uint) (filename_end - basename_begin)) ^ compiler->new_entry.file_size;
    12611261        }
    12621262
     
    12641264        compiler->entry_hash.entryslotid = xc_hash_fold(
    12651265                compiler->new_entry.file_inode
    1266                 ? (xc_hash_value_t) HASH(compiler->new_entry.file_device + compiler->new_entry.file_inode)
     1266                ? (xc_hash_value_t) HASH(compiler->new_entry.file_device ^ compiler->new_entry.file_inode ^ compiler->new_entry.file_size)
    12671267                : basename_hash_value
    12681268                , &xc_php_hentry);
Note: See TracChangeset for help on using the changeset viewer.