git.schokokeks.org
Repositories
Help
Report an Issue
keks-overlay.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
c5fc303
Branches
Tags
master
keks-overlay.git
dev-php5
pecl-apc
files
pecl-apc-3.0.17-fix-useless-warnings.diff
pecl-apc: dämliche warnings ausschalten
Hanno Böck
commited
c5fc303
at 2011-04-06 19:54:15
pecl-apc-3.0.17-fix-useless-warnings.diff
Blame
History
Raw
diff -Naur APC-3.1.7/apc_bin.c APC-3.1.7-1//apc_bin.c --- APC-3.1.7/apc_bin.c 2011-01-11 20:06:38.000000000 +0100 +++ APC-3.1.7-1//apc_bin.c 2011-04-06 19:28:51.048623272 +0200 @@ -703,7 +703,7 @@ apc_bd_alloc_ex(pool_ptr, sizeof(apc_pool) TSRMLS_CC); ctxt.pool = apc_pool_create(APC_UNPOOL, apc_bd_alloc, apc_bd_free, NULL, NULL TSRMLS_CC); /* ideally the pool wouldn't be alloc'd as part of this */ if (!ctxt.pool) { /* TODO need to cleanup */ - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + php_log_err("Unable to allocate memory for pool." TSRMLS_CC); return NULL; } ctxt.copy = APC_COPY_IN_USER; /* avoid stupid ALLOC_ZVAL calls here, hack */ @@ -854,7 +854,7 @@ for(i = 0; i < bd->num_entries; i++) { ctxt.pool = apc_pool_create(APC_SMALL_POOL, apc_sma_malloc, apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); if (!ctxt.pool) { /* TODO need to cleanup previous pools */ - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + php_log_err("Unable to allocate memory for pool." TSRMLS_CC); goto failure; } ep = &bd->entries[i]; diff -Naur APC-3.1.7/apc_cache.c APC-3.1.7-1//apc_cache.c --- APC-3.1.7/apc_cache.c 2011-01-11 20:06:38.000000000 +0100 +++ APC-3.1.7-1//apc_cache.c 2011-04-06 19:29:39.271030454 +0200 @@ -1270,6 +1270,7 @@ /* {{{ apc_cache_is_last_key */ zend_bool apc_cache_is_last_key(apc_cache_t* cache, apc_cache_key_t* key, unsigned int h, time_t t TSRMLS_DC) { + char *log_message; apc_keyid_t *lastkey = &cache->header->lastkey; unsigned int keylen = key->data.user.identifier_len; #ifdef ZTS @@ -1288,7 +1289,10 @@ if(lastkey->mtime == t && FROM_DIFFERENT_THREAD(lastkey)) { /* potential cache slam */ if(APCG(slam_defense)) { - apc_warning("Potential cache slam averted for key '%s'" TSRMLS_CC, key->data.user.identifier); + log_message = emalloc((key->data.user.identifier_len + 40) * sizeof(char)); + sprintf(log_message, "Potential cache slam averted for key '%s'", key->data.user.identifier); + php_log_err(log_message TSRMLS_CC); + efree(log_message); return 1; } } diff -Naur APC-3.1.7/apc_main.c APC-3.1.7-1//apc_main.c --- APC-3.1.7/apc_main.c 2011-01-11 20:06:38.000000000 +0100 +++ APC-3.1.7-1//apc_main.c 2011-04-06 19:28:51.049623231 +0200 @@ -414,7 +414,7 @@ ctxt.pool = apc_pool_create(APC_MEDIUM_POOL, apc_sma_malloc, apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); if (!ctxt.pool) { - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + php_log_err("Unable to allocate memory for pool." TSRMLS_CC); return FAILURE; } ctxt.copy = APC_COPY_IN_OPCODE; @@ -539,7 +539,7 @@ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); if (!ctxt.pool) { - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + php_log_err("Unable to allocate memory for pool." TSRMLS_CC); return old_compile_file(h, type TSRMLS_CC); } ctxt.copy = APC_COPY_OUT_OPCODE; diff -Naur APC-3.1.7/php_apc.c APC-3.1.7-1//php_apc.c --- APC-3.1.7/php_apc.c 2011-01-11 20:06:38.000000000 +0100 +++ APC-3.1.7-1//php_apc.c 2011-04-06 19:28:51.049623231 +0200 @@ -578,7 +578,7 @@ ctxt.pool = apc_pool_create(APC_SMALL_POOL, apc_sma_malloc, apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); if (!ctxt.pool) { - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + php_log_err("Unable to allocate memory for pool." TSRMLS_CC); return 0; } ctxt.copy = APC_COPY_IN_USER; @@ -819,7 +819,7 @@ ctxt.pool = apc_pool_create(APC_UNPOOL, apc_php_malloc, apc_php_free, NULL, NULL TSRMLS_CC); if (!ctxt.pool) { - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); + php_log_err("Unable to allocate memory for pool." TSRMLS_CC); RETURN_FALSE; } ctxt.copy = APC_COPY_OUT_USER;