Changeset 220

Show
Ignore:
Timestamp:
06/27/06 12:12:03 (2 years ago)
Author:
bart
Message:

* Fixed ifdef for #108 to use only on windows
* Fix for bug #109, #31 and SF-1102070
* Cleaned-up RINIT

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r219 r220  
     12006-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 
    172006-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 
    411 
    5122006-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> 
    816 
    9172006-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 
    1322 
    14232006-05-14  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
  • eaccelerator/trunk/eaccelerator.c

    r219 r220  
    44   +----------------------------------------------------------------------+ 
    55   | Copyright (c) 2004 - 2006 eAccelerator                               | 
    6    | http://eaccelerator.net                                                    | 
     6   | http://eaccelerator.net                                                                                    | 
    77   +----------------------------------------------------------------------+ 
    88   | This program is free software; you can redistribute it and/or        | 
     
    604604 
    605605/******************************************************************************/ 
    606 /* Cache file functions.                                                                                                          */ 
     606/* Cache file functions.                                                                                                               */ 
    607607/******************************************************************************/ 
    608608 
     
    936936      EAG(used_entries) = (void*)used; 
    937937      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; 
    945951    } 
    946952  } 
     
    12531259#endif 
    12541260 
    1255   DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "[%d] Enter COMPILE\n",getpid())); 
    12561261  DBG(ea_debug_start_time, (&tv_start)); 
    12571262  DBG(ea_debug_printf, (EA_DEBUG, "[%d] Enter COMPILE\n",getpid())); 
     
    12601265  EAG(xpad)+=2; 
    12611266#endif 
     1267 
    12621268  compile_time = time(0); 
    12631269  stat_result = eaccelerator_stat(file_handle, realname, &buf TSRMLS_CC); 
     
    13211327      file_handle->handle.fp = NULL; 
    13221328#endif 
    1323 /*??? I don't understud way estrdup is not need 
    1324       file_handle->opened_path = estrdup(EAG(mem)); 
    1325 */ 
    13261329    } 
    13271330    DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "\t[%d] compile_file: restored (%ld)\n", getpid(), ea_debug_elapsed_time(&tv_start))); 
     
    20842087PHP_RINIT_FUNCTION(eaccelerator) 
    20852088{ 
    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) { 
    20882095                return SUCCESS; 
    20892096        } 
     2097 
    20902098        /* 
    2091          * HOESH: Initialization on first call, 
    2092          * came from eaccelerator_zend_startup(). 
     2099         * Initialization on first call, comes from eaccelerator_zend_startup(). 
    20932100         */ 
    2094         if (eaccelerator_global_function_table.nTableSize == 0) 
    2095         { 
     2101        if (eaccelerator_global_function_table.nTableSize == 0) { 
    20962102                zend_function tmp_func; 
    20972103                zend_class_entry tmp_class; 
    20982104 
    20992105                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)); 
    21012108                 
    21022109                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)); 
    21042112        } 
     2113 
    21052114        DBG(ea_debug_printf, (EA_DEBUG, "[%d] Enter RINIT\n",getpid())); 
    21062115        DBG(ea_debug_put, (EA_PROFILE_OPCODES, "\n========================================\n")); 
     
    21132122        EAG(compress_content) = 1; 
    21142123        EAG(content_headers) = NULL; 
     2124 
    21152125        /* Storing Host Name */ 
    21162126        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 && 
    21282128                        Z_TYPE_PP(server_vars.v) == IS_ARRAY && 
    21292129                        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'; 
    21422136                } 
    2143         } 
     2137  } 
     2138 
     2139        /* initialise the hash that contains the restored files */ 
     2140        zend_hash_init(&EAG(restored), 0, NULL, NULL, 0); 
     2141 
    21442142        DBG(ea_debug_printf, (EA_DEBUG, "[%d] Leave RINIT\n",getpid())); 
    21452143#ifdef DEBUG 
     
    21472145        EAG(profile_level) = 0; 
    21482146#endif 
     2147 
    21492148#ifdef WITH_EACCELERATOR_CRASH_DETECTION 
    21502149#ifdef SIGSEGV 
     
    21722171                return SUCCESS; 
    21732172        } 
     2173        ea_debug_hash_display(&EAG(restored)); 
     2174        zend_hash_destroy(&EAG(restored)); 
    21742175#ifdef WITH_EACCELERATOR_CRASH_DETECTION 
    21752176#ifdef SIGSEGV 
  • eaccelerator/trunk/eaccelerator.h

    r219 r220  
    103103#endif 
    104104 
    105 #ifndef _INTPTR_T_DEFINED  
     105#if !defined(_INTPTR_T_DEFINED) && ZEND_WIN32 
    106106        typedef intptr_t; 
    107107        #define _INTPTR_T_DEFINED 
     
    449449char *allowed_admin_path; 
    450450HashTable strings; 
     451HashTable restored; 
    451452zend_class_entry *class_entry; 
    452453mm_cond_entry *cond_list;