php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch bug52144.patch for APC Bug #52144Patch version 2012-11-01 03:10 UTC Return to Bug #52144 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: laruence@php.netIndex: apc_main.c =================================================================== --- apc_main.c (revision 328200) +++ apc_main.c (working copy) @@ -484,7 +484,8 @@ int bailout=0; const char* filename = NULL; - if (!APCG(enabled) || apc_cache_busy(apc_cache)) { + if (!APCG(enabled) || apc_cache_busy(apc_cache) || APCG(skip_cache)) { + APCG(skip_cache) = 1; return old_compile_file(h, type TSRMLS_CC); } @@ -499,9 +500,11 @@ int ret = apc_regex_match_array(APCG(compiled_filters), filename); if(ret == APC_NEGATIVE_MATCH || (ret != APC_POSITIVE_MATCH && !APCG(cache_by_default))) { + APCG(skip_cache) = 1; return old_compile_file(h, type TSRMLS_CC); } } else if(!APCG(cache_by_default)) { + APCG(skip_cache) = 1; return old_compile_file(h, type TSRMLS_CC); } APCG(current_cache) = apc_cache; @@ -532,6 +535,7 @@ apc_sma_protect, apc_sma_unprotect TSRMLS_CC); if (!ctxt.pool) { apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + APCG(skip_cache) = 1; return old_compile_file(h, type TSRMLS_CC); } ctxt.copy = APC_COPY_OUT_OPCODE; @@ -581,11 +585,13 @@ } else { if (apc_search_paths(h->filename, PG(include_path), &fileinfo TSRMLS_CC) != 0) { apc_debug("Stat failed %s - bailing (%s) (%d)\n" TSRMLS_CC,h->filename,SG(request_info).path_translated); + APCG(skip_cache) = 1; return old_compile_file(h, type TSRMLS_CC); } } if (APCG(max_file_size) < fileinfo.st_buf.sb.st_size) { apc_debug("File is too big %s (%ld) - bailing\n" TSRMLS_CC, h->filename, fileinfo.st_buf.sb.st_size); + APCG(skip_cache) = 1; return old_compile_file(h, type TSRMLS_CC); } key.mtime = fileinfo.st_buf.sb.st_mtime; @@ -596,6 +602,7 @@ #if NONBLOCKING_LOCK_AVAILABLE if(APCG(write_lock)) { if(!apc_cache_write_lock(apc_cache TSRMLS_CC)) { + APCG(skip_cache) = 1; HANDLE_UNBLOCK_INTERRUPTIONS(); return old_compile_file(h, type TSRMLS_CC); } Index: apc_globals.h =================================================================== --- apc_globals.h (revision 328200) +++ apc_globals.h (working copy) @@ -124,6 +124,7 @@ #endif char *serializer_name; /* the serializer config option */ apc_serializer_t *serializer;/* the actual serializer in use */ + zend_bool skip_cache; /* if error occurred, skip caching for this request lifecycle */ ZEND_END_MODULE_GLOBALS(apc) /* (the following declaration is defined in php_apc.c) */ Index: php_apc.c =================================================================== --- php_apc.c (revision 328200) +++ php_apc.c (working copy) @@ -395,6 +395,7 @@ #if HAVE_SIGACTION apc_set_signals(TSRMLS_C); #endif + APCG(skip_cache) = 0; } return SUCCESS; } |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Sat Nov 23 01:01:33 2024 UTC |