Changeset 957 in svn


Ignore:
Timestamp:
2012-07-07T05:40:06+02:00 (3 years ago)
Author:
Xuefer
Message:

adds to open_files whenever old_compile_file is not called

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r956 r957  
    746746/* }}} */
    747747
    748 static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php, zend_file_handle *h TSRMLS_DC) /* {{{ */
     748static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php TSRMLS_DC) /* {{{ */
    749749{
    750750    zend_uint i;
     
    818818    zend_hash_add(&EG(included_files), entry_php->entry.name.str.val, entry_php->entry.name.str.len+1, (void *)&i, sizeof(int), NULL);
    819819#endif
    820     if (h) {
    821         zend_llist_add_element(&CG(open_files), h);
    822     }
    823820
    824821#ifndef ZEND_ENGINE_2
     
    18451842}
    18461843/* }}} */
    1847 static zend_op_array *xc_compile_restore(xc_entry_php_t *stored_entry, xc_entry_data_php_t *stored_php, zend_file_handle *h TSRMLS_DC) /* {{{ */
     1844static zend_op_array *xc_compile_restore(xc_entry_php_t *stored_entry, xc_entry_data_php_t *stored_php TSRMLS_DC) /* {{{ */
    18481845{
    18491846    zend_op_array *op_array;
     
    18651862    catched = 0;
    18661863    zend_try {
    1867         op_array = xc_entry_install(&restored_entry, h TSRMLS_CC);
     1864        op_array = xc_entry_install(&restored_entry TSRMLS_CC);
    18681865    } zend_catch {
    18691866        catched = 1;
     
    19781975
    19791976    if (stored_entry) {
     1977        sandboxed_compiler->stored_entry = stored_entry;
     1978        sandboxed_compiler->stored_php = stored_php;
     1979        /* discard newly compiled result, restore from stored one */
    19801980        if (compiler->new_php.op_array) {
    19811981#ifdef ZEND_ENGINE_2
     
    19861986            efree(compiler->new_php.op_array);
    19871987            compiler->new_php.op_array = NULL;
    1988             sandboxed_compiler->h = NULL;
    1989         }
    1990         sandboxed_compiler->stored_entry = stored_entry;
    1991         sandboxed_compiler->stored_php = stored_php;
    1992         /* sandbox no install */
     1988        }
    19931989        return NULL;
    19941990    }
    19951991    else {
    1996         /* install it with sandbox */
    19971992        return compiler->new_php.op_array;
    19981993    }
     
    21232118    /* found entry */
    21242119    if (stored_entry && stored_php) {
    2125         return xc_compile_restore(stored_entry, stored_php, NULL /* h */ TSRMLS_CC);
     2120        zend_llist_add_element(&CG(open_files), h);
     2121        return xc_compile_restore(stored_entry, stored_php TSRMLS_CC);
    21262122    }
    21272123
     
    21392135    op_array = xc_sandbox(xc_compile_file_sandboxed, (void *) &sandboxed_compiler, h->opened_path ? h->opened_path : h->filename TSRMLS_CC);
    21402136    if (sandboxed_compiler.stored_entry) {
    2141         return xc_compile_restore(sandboxed_compiler.stored_entry, sandboxed_compiler.stored_php, sandboxed_compiler.h TSRMLS_CC);
     2137        return xc_compile_restore(sandboxed_compiler.stored_entry, sandboxed_compiler.stored_php TSRMLS_CC);
    21422138    }
    21432139    else {
     
    21662162#endif
    21672163     ) {
    2168         op_array = old_compile_file(h, type TSRMLS_CC);
    21692164        TRACE("%s", "cacher not enabled");
    2170         return op_array;
     2165        return old_compile_file(h, type TSRMLS_CC);
    21712166    }
    21722167
Note: See TracChangeset for help on using the changeset viewer.