Changeset 602 in svn for branches/1.3/xcache.c


Ignore:
Timestamp:
2009-07-05T07:49:25+02:00 (6 years ago)
Author:
Xuefer
Message:

merged r363,r366,r376,r381,r382,r383,r384,r385,r386,r387 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/xcache.c

    r601 r602  
    392392    xc_mem_t *mem = cache->mem;
    393393    const xc_mem_handlers_t *handlers = mem->handlers;
    394     zend_ulong interval = (cachetype == XC_TYPE_PHP) ? xc_php_gc_interval : xc_var_gc_interval;
     394    zend_ulong interval;
     395    if (cachetype == XC_TYPE_PHP) {
     396        interval = xc_php_ttl ? xc_php_gc_interval : 0;
     397    }
     398    else {
     399        interval = xc_var_gc_interval;
     400    }
    395401
    396402    add_assoc_long_ex(return_value, ZEND_STRS("slots"),     cache->hentry->size);
     
    405411    add_assoc_long_ex(return_value, ZEND_STRS("deleted"),   cache->deletes_count);
    406412    if (interval) {
    407         add_assoc_long_ex(return_value, ZEND_STRS("gc"),    (cache->last_gc_expires + interval) - XG(request_time));
     413        time_t gc = (cache->last_gc_expires + interval) - XG(request_time);
     414        add_assoc_long_ex(return_value, ZEND_STRS("gc"),    gc > 0 ? gc : 0);
    408415    }
    409416    else {
     
    16241631    }
    16251632
    1626 #define STR "WWW-authenticate: basic realm='XCache Administration'"
     1633#define STR "WWW-authenticate: Basic Realm=\"XCache Administration\""
    16271634    sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC);
    16281635#undef STR
     
    24532460static void xc_zend_extension_register(zend_extension *new_extension, DL_HANDLE handle)
    24542461{
    2455     zend_extension extension;
    2456 
    2457     extension = *new_extension;
    2458     extension.handle = handle;
    2459 
    2460     zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
    2461 
    2462     zend_llist_prepend_element(&zend_extensions, &extension);
     2462    zend_extension extension;
     2463
     2464    extension = *new_extension;
     2465    extension.handle = handle;
     2466
     2467    zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
     2468
     2469    zend_llist_prepend_element(&zend_extensions, &extension);
    24632470    TRACE("%s", "registered");
    24642471}
     
    25132520static int xc_zend_extension_startup(zend_extension *extension)
    25142521{
    2515     if (extension->startup) {
    2516         if (extension->startup(extension) != SUCCESS) {
     2522    if (extension->startup) {
     2523        if (extension->startup(extension) != SUCCESS) {
    25172524            return FAILURE;
    2518         }
    2519     }
     2525        }
     2526    }
    25202527    return SUCCESS;
    25212528}
Note: See TracChangeset for help on using the changeset viewer.