Ticket #152: inode_swap.diff

File inode_swap.diff, 1.3 KB (added by thomasb, 5 years ago)

Patch

  • xcache-1.2.2

    old new  
    222222    } 
    223223    assert(0); 
    224224} 
     225 
     226/* }}} */ 
     227static inline int xc_cmp_names(xc_entry_t *a, xc_entry_t *b) { 
     228    return memcmp(a->name.str.val, b->name.str.val, a->name.str.len + 1) == 0; 
     229} 
     230 
    225231/* }}} */ 
    226232static xc_entry_t *xc_entry_find_dmz(xc_entry_t *xce TSRMLS_DC) /* {{{ */ 
    227233{ 
    228234    xc_entry_t *p; 
    229235    for (p = xce->cache->entries[xce->hvalue]; p; p = p->next) { 
    230236        if (xc_entry_equal_dmz(xce, p)) { 
    231             if (p->type == XC_TYPE_VAR || /* PHP */ p->data.php->mtime == xce->data.php->mtime) { 
     237            if (p->type == XC_TYPE_VAR || /* PHP */ (p->data.php->mtime == xce->data.php->mtime && xc_cmp_names(p, xce))) { 
    232238                p->hits ++; 
    233239                p->atime = XG(request_time); 
    234240                return p; 
     
    790796        php->sourcesize   = 0; 
    791797    } 
    792798 
    793 #ifdef HAVE_INODE 
    794     if (!php->inode) 
    795 #endif 
    796     { 
    797         /* hash on filename, let's expand it to real path */ 
    798         filename = expand_filepath(filename, opened_path_buffer TSRMLS_CC); 
    799         if (filename == NULL) { 
    800             return 0; 
    801         } 
     799    /* hash on filename, let's expand it to real path */ 
     800    filename = expand_filepath(filename, opened_path_buffer TSRMLS_CC); 
     801    if (filename == NULL) { 
     802        return 0; 
    802803    } 
    803804 
    804805    UNISW(NOTHING, xce->name_type = IS_STRING;)