Changeset 220
- Timestamp:
- 06/27/06 12:12:03 (2 years ago)
- Files:
-
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/eaccelerator.c (modified) (10 diffs)
- eaccelerator/trunk/eaccelerator.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ChangeLog
r219 r220 1 2006-06-27 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 3 * Fixed ifdef for #108 to use only on windows 4 * Fix for bug #109, #31 and SF-1102070 5 * Cleaned-up RINIT a bit for hostname determining 6 1 7 2006-06-26 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 * Fix ticket #108 3 * Removed webui.[c|h] from the windows project files 8 9 * Fix ticket #108 10 * Removed webui.[c|h] from the windows project files 4 11 5 12 2006-06-06 Hans Rakers <hans at parse dot nl> 6 * Fix for ticket #101 ('bailout' is used in zend_globals.h in a ZTS 7 build) as suggested by <ihanick at gmail dot com> 13 14 * Fix for ticket #101 ('bailout' is used in zend_globals.h in a ZTS 15 build) as suggested by <ihanick at gmail dot com> 8 16 9 17 2006-06-02 Hans Rakers <hans at parse dot nl> 10 * Removed two unused vars from the internal datastructures 11 * Fixed constructor inheritance. This fixes handling of implicit 12 constructors and solves ticket #89 18 19 * Removed two unused vars from the internal datastructures 20 * Fixed constructor inheritance. This fixes handling of implicit 21 constructors and solves ticket #89 13 22 14 23 2006-05-14 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> eaccelerator/trunk/eaccelerator.c
r219 r220 4 4 +----------------------------------------------------------------------+ 5 5 | Copyright (c) 2004 - 2006 eAccelerator | 6 | http://eaccelerator.net |6 | http://eaccelerator.net | 7 7 +----------------------------------------------------------------------+ 8 8 | This program is free software; you can redistribute it and/or | … … 604 604 605 605 /******************************************************************************/ 606 /* Cache file functions. */606 /* Cache file functions. */ 607 607 /******************************************************************************/ 608 608 … … 936 936 EAG(used_entries) = (void*)used; 937 937 EAG(mem) = op_array->filename; 938 for (e = p->c_head; e!=NULL; e = e->next) { 939 restore_class(e TSRMLS_CC); 940 } 941 for (e = p->f_head; e!=NULL; e = e->next) { 942 restore_function(e TSRMLS_CC); 943 } 944 EAG(mem) = p->realfilename; 938 /* only restore the classes and functions when we restore this script 939 * for the first time. 940 */ 941 if (!zend_hash_exists(&EAG(restored), p->realfilename, strlen(p->realfilename))) { 942 for (e = p->c_head; e!=NULL; e = e->next) { 943 restore_class(e TSRMLS_CC); 944 } 945 for (e = p->f_head; e!=NULL; e = e->next) { 946 restore_function(e TSRMLS_CC); 947 } 948 zend_hash_add(&EAG(restored), p->realfilename, strlen(p->realfilename), NULL, 0, NULL); 949 } 950 EAG(mem) = p->realfilename; 945 951 } 946 952 } … … 1253 1259 #endif 1254 1260 1255 DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "[%d] Enter COMPILE\n",getpid()));1256 1261 DBG(ea_debug_start_time, (&tv_start)); 1257 1262 DBG(ea_debug_printf, (EA_DEBUG, "[%d] Enter COMPILE\n",getpid())); … … 1260 1265 EAG(xpad)+=2; 1261 1266 #endif 1267 1262 1268 compile_time = time(0); 1263 1269 stat_result = eaccelerator_stat(file_handle, realname, &buf TSRMLS_CC); … … 1321 1327 file_handle->handle.fp = NULL; 1322 1328 #endif 1323 /*??? I don't understud way estrdup is not need1324 file_handle->opened_path = estrdup(EAG(mem));1325 */1326 1329 } 1327 1330 DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "\t[%d] compile_file: restored (%ld)\n", getpid(), ea_debug_elapsed_time(&tv_start))); … … 2084 2087 PHP_RINIT_FUNCTION(eaccelerator) 2085 2088 { 2086 if (eaccelerator_mm_instance == NULL) 2087 { 2089 union { 2090 zval **v; 2091 void *ptr; 2092 } server_vars, hostname; 2093 2094 if (eaccelerator_mm_instance == NULL) { 2088 2095 return SUCCESS; 2089 2096 } 2097 2090 2098 /* 2091 * HOESH: Initialization on first call, 2092 * came from eaccelerator_zend_startup(). 2099 * Initialization on first call, comes from eaccelerator_zend_startup(). 2093 2100 */ 2094 if (eaccelerator_global_function_table.nTableSize == 0) 2095 { 2101 if (eaccelerator_global_function_table.nTableSize == 0) { 2096 2102 zend_function tmp_func; 2097 2103 zend_class_entry tmp_class; 2098 2104 2099 2105 zend_hash_init_ex(&eaccelerator_global_function_table, 100, NULL, NULL, 1, 0); 2100 zend_hash_copy(&eaccelerator_global_function_table, CG(function_table), NULL, &tmp_func, sizeof(zend_function)); 2106 zend_hash_copy(&eaccelerator_global_function_table, CG(function_table), NULL, 2107 &tmp_func, sizeof(zend_function)); 2101 2108 2102 2109 zend_hash_init_ex(&eaccelerator_global_class_table, 10, NULL, NULL, 1, 0); 2103 zend_hash_copy(&eaccelerator_global_class_table, CG(class_table), NULL, &tmp_class, sizeof(zend_class_entry)); 2110 zend_hash_copy(&eaccelerator_global_class_table, CG(class_table), NULL, 2111 &tmp_class, sizeof(zend_class_entry)); 2104 2112 } 2113 2105 2114 DBG(ea_debug_printf, (EA_DEBUG, "[%d] Enter RINIT\n",getpid())); 2106 2115 DBG(ea_debug_put, (EA_PROFILE_OPCODES, "\n========================================\n")); … … 2113 2122 EAG(compress_content) = 1; 2114 2123 EAG(content_headers) = NULL; 2124 2115 2125 /* Storing Host Name */ 2116 2126 EAG(hostname)[0] = '\000'; 2117 { 2118 union { 2119 zval **v; 2120 void *ptr; 2121 } server_vars; 2122 union { 2123 zval **v; 2124 void *ptr; 2125 } hostname; 2126 2127 if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), &server_vars.ptr) == SUCCESS && 2127 if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), &server_vars.ptr) == SUCCESS && 2128 2128 Z_TYPE_PP(server_vars.v) == IS_ARRAY && 2129 2129 zend_hash_find(Z_ARRVAL_PP(server_vars.v), "SERVER_NAME", sizeof("SERVER_NAME"), &hostname.ptr)==SUCCESS && 2130 Z_TYPE_PP(hostname.v) == IS_STRING && 2131 Z_STRLEN_PP(hostname.v) > 0) 2132 { 2133 if (sizeof(EAG(hostname)) > Z_STRLEN_PP(hostname.v)) 2134 { 2135 memcpy(EAG(hostname),Z_STRVAL_PP(hostname.v),Z_STRLEN_PP(hostname.v)+1); 2136 } 2137 else 2138 { 2139 memcpy(EAG(hostname),Z_STRVAL_PP(hostname.v),sizeof(EAG(hostname))-1); 2140 EAG(hostname)[sizeof(EAG(hostname))-1] = '\000'; 2141 } 2130 Z_TYPE_PP(hostname.v) == IS_STRING && Z_STRLEN_PP(hostname.v) > 0) { 2131 if (sizeof(EAG(hostname)) > Z_STRLEN_PP(hostname.v)) { 2132 memcpy(EAG(hostname),Z_STRVAL_PP(hostname.v),Z_STRLEN_PP(hostname.v)+1); 2133 } else { 2134 memcpy(EAG(hostname),Z_STRVAL_PP(hostname.v),sizeof(EAG(hostname))-1); 2135 EAG(hostname)[sizeof(EAG(hostname))-1] = '\000'; 2142 2136 } 2143 } 2137 } 2138 2139 /* initialise the hash that contains the restored files */ 2140 zend_hash_init(&EAG(restored), 0, NULL, NULL, 0); 2141 2144 2142 DBG(ea_debug_printf, (EA_DEBUG, "[%d] Leave RINIT\n",getpid())); 2145 2143 #ifdef DEBUG … … 2147 2145 EAG(profile_level) = 0; 2148 2146 #endif 2147 2149 2148 #ifdef WITH_EACCELERATOR_CRASH_DETECTION 2150 2149 #ifdef SIGSEGV … … 2172 2171 return SUCCESS; 2173 2172 } 2173 ea_debug_hash_display(&EAG(restored)); 2174 zend_hash_destroy(&EAG(restored)); 2174 2175 #ifdef WITH_EACCELERATOR_CRASH_DETECTION 2175 2176 #ifdef SIGSEGV eaccelerator/trunk/eaccelerator.h
r219 r220 103 103 #endif 104 104 105 #if ndef _INTPTR_T_DEFINED105 #if !defined(_INTPTR_T_DEFINED) && ZEND_WIN32 106 106 typedef intptr_t; 107 107 #define _INTPTR_T_DEFINED … … 449 449 char *allowed_admin_path; 450 450 HashTable strings; 451 HashTable restored; 451 452 zend_class_entry *class_entry; 452 453 mm_cond_entry *cond_list;