CVS update: php3

From: Date: Fri, 18 Dec 1998 12:00:17 +0000
Subject: CVS update: php3
Groups: php.dev 
Request: Send a blank email to php-dev+get-2838@lists.php.net to get a copy of this message
Date: Friday December 18, 1998 @ 7:00 Author: zeev Update of /repository/php3 In directory asf:/u/temp/cvs-serv661 Modified Files: ChangeLog alloc.c main.c Log Message: Fix the memory manager limit bug Index: php3/ChangeLog diff -c php3/ChangeLog:1.533 php3/ChangeLog:1.534 *** php3/ChangeLog:1.533 Thu Dec 17 11:21:55 1998 --- php3/ChangeLog Fri Dec 18 07:00:16 1998 *************** *** 1,6 **** --- 1,8 ---- PHP 3.0 CHANGE LOG ChangeLog ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ??, Version 3.0.6 + - Fixed a bug in the memory limit code, in cases where $php_errormsg was + also used. - Add chr_replace() function - Add iptcparse() function - Adobe FDF supported Index: php3/alloc.c diff -c php3/alloc.c:1.72 php3/alloc.c:1.73 *** php3/alloc.c:1.72 Sat Oct 17 14:17:26 1998 --- php3/alloc.c Fri Dec 18 07:00:16 1998 *************** *** 46,51 **** --- 46,52 ---- # if MEMORY_LIMIT static unsigned int allocated_memory; + static unsigned char memory_exhausted; #endif #endif *************** *** 65,72 **** php3_log_err(buf); \ } \ exit(1); \ ! } else {\ if (!GLOBAL(shutdown_requested)) { \ if (!file) { \ php3_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)",php3_ini.memory_limit,s); \ } else { \ --- 66,76 ---- php3_log_err(buf); \ } \ exit(1); \ ! } else if (memory_exhausted) { \ ! /* do nothing, let it go through */ \ ! } else { \ if (!GLOBAL(shutdown_requested)) { \ + memory_exhausted=1; \ if (!file) { \ php3_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)",php3_ini.memory_limit,s); \ } else { \ *************** *** 327,332 **** --- 331,337 ---- #if MEMORY_LIMIT allocated_memory=0; + memory_exhausted=0; #endif memset(GLOBAL(cache_count),0,MAX_CACHED_MEMORY*sizeof(unsigned char)); Index: php3/main.c diff -c php3/main.c:1.481 php3/main.c:1.482 *** php3/main.c:1.481 Fri Dec 4 12:44:45 1998 --- php3/main.c Fri Dec 18 07:00:16 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 1.481 1998/12/04 17:44:45 ssb Exp $ */ /* #define CRASH_DETECTION */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 1.482 1998/12/18 12:00:16 zeev Exp $ */ /* #define CRASH_DETECTION */ *************** *** 884,889 **** --- 884,894 ---- static int php3_config_ini_startup(INLINE_TLS_VOID) { + /* set the memory limit to a reasonable number so that we can get + * through this startup phase properly + */ + php3_ini.memory_limit=1<<23; /* 8MB */ + if (php3_init_config() == FAILURE) { php3_printf("PHP: Unable to parse configuration file.\n"); return FAILURE; *************** *** 901,907 **** php3_ini.max_execution_time = 30; } if (cfg_get_long("memory_limit", &php3_ini.memory_limit) == FAILURE) { ! php3_ini.memory_limit = 8 * 1048576; } if (cfg_get_long("precision", &php3_ini.precision) == FAILURE) { php3_ini.precision = 14; --- 906,912 ---- php3_ini.max_execution_time = 30; } if (cfg_get_long("memory_limit", &php3_ini.memory_limit) == FAILURE) { ! php3_ini.memory_limit = 1<<23; /* 8MB */ } if (cfg_get_long("precision", &php3_ini.precision) == FAILURE) { php3_ini.precision = 14; *************** *** 1107,1113 **** #endif start_memory_manager(); ! #if HAVE_SETLOCALE setlocale(LC_CTYPE, ""); #endif --- 1112,1124 ---- #endif start_memory_manager(); ! ! #if !USE_SAPI ! if (php3_config_ini_startup(_INLINE_TLS_VOID) == FAILURE) { ! return FAILURE; ! } ! #endif ! #if HAVE_SETLOCALE setlocale(LC_CTYPE, ""); #endif *************** *** 1158,1169 **** return FAILURE; } GLOBAL(module_initialized) |= INIT_CONSTANTS; - - #if !USE_SAPI - if (php3_config_ini_startup(_INLINE_TLS_VOID) == FAILURE) { - return FAILURE; - } - #endif if (module_startup_modules() == FAILURE) { php3_printf("Unable to start modules\n"); --- 1169,1174 ---- -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2838) next »