cvs: php-src /ext/mssql php_mssql.c /ext/session session.c /ext/sybase php_sybase_db.c /ext/sybase_ct php_sybase_ct.c /ext/w32api w32api.c /main
php_variables.c rfc1867.c /sapi/apache mod_php5.c /sapi/apache_hooks mod_php5.c

From: Date: Sat, 10 Jul 2004 07:46:10 +0000
Subject: cvs: php-src /ext/mssql php_mssql.c /ext/session session.c /ext/sybase php_sybase_db.c /ext/sybase_ct php_sybase_ct.c /ext/w32api w32api.c /main
php_variables.c rfc1867.c /sapi/apache mod_php5.c /sapi/apache_hooks mod_php5.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-27777@lists.php.net to get a copy of this message
andi Sat Jul 10 03:46:10 2004 EDT Modified files: /php-src/ext/mssql php_mssql.c /php-src/ext/session session.c /php-src/ext/sybase php_sybase_db.c /php-src/ext/sybase_ct php_sybase_ct.c /php-src/ext/w32api w32api.c /php-src/main php_variables.c rfc1867.c /php-src/sapi/apache mod_php5.c /php-src/sapi/apache_hooks mod_php5.c Log: - Better stability during premature shutdown of request startup

http://cvs.php.net/diff.php/php-src/ext/mssql/php_mssql.c?r1=1.136&r2=1.137&ty=u Index: php-src/ext/mssql/php_mssql.c diff -u php-src/ext/mssql/php_mssql.c:1.136 php-src/ext/mssql/php_mssql.c:1.137 --- php-src/ext/mssql/php_mssql.c:1.136 Wed Jun 30 15:46:57 2004 +++ php-src/ext/mssql/php_mssql.c Sat Jul 10 03:46:08 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mssql.c,v 1.136 2004/06/30 19:46:57 fmk Exp $ */ +/* $Id: php_mssql.c,v 1.137 2004/07/10 07:46:08 andi Exp $ */ #ifdef COMPILE_DL_MSSQL #define HAVE_MSSQL 1 @@ -348,6 +348,7 @@ PHP_RSHUTDOWN_FUNCTION(mssql) { STR_FREE(MS_SQL_G(appname)); + MS_SQL_G(appname) = NULL; if (MS_SQL_G(server_message)) { STR_FREE(MS_SQL_G(server_message)); MS_SQL_G(server_message) = NULL; http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.390&r2=1.391&ty=u Index: php-src/ext/session/session.c diff -u php-src/ext/session/session.c:1.390 php-src/ext/session/session.c:1.391 --- php-src/ext/session/session.c:1.390 Sat May 8 01:58:18 2004 +++ php-src/ext/session/session.c Sat Jul 10 03:46:08 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.390 2004/05/08 05:58:18 pollita Exp $ */ +/* $Id: session.c,v 1.391 2004/07/10 07:46:08 andi Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -518,13 +518,16 @@ static void php_session_track_init(TSRMLS_D) { + zval *session_vars = NULL; + /* Unconditionally destroy existing arrays -- possible dirty data */ zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS")); zend_hash_del(&EG(symbol_table), "_SESSION", sizeof("_SESSION")); - MAKE_STD_ZVAL(PS(http_session_vars)); - array_init(PS(http_session_vars)); + MAKE_STD_ZVAL(session_vars); + array_init(session_vars); + PS(http_session_vars) = session_vars; ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 2, 1); ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); http://cvs.php.net/diff.php/php-src/ext/sybase/php_sybase_db.c?r1=1.61&r2=1.62&ty=u Index: php-src/ext/sybase/php_sybase_db.c diff -u php-src/ext/sybase/php_sybase_db.c:1.61 php-src/ext/sybase/php_sybase_db.c:1.62 --- php-src/ext/sybase/php_sybase_db.c:1.61 Fri Apr 16 12:27:13 2004 +++ php-src/ext/sybase/php_sybase_db.c Sat Jul 10 03:46:08 2004 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_db.c,v 1.61 2004/04/16 16:27:13 thetaphi Exp $ */ +/* $Id: php_sybase_db.c,v 1.62 2004/07/10 07:46:08 andi Exp $ */ #ifdef HAVE_CONFIG_H @@ -297,7 +297,9 @@ PHP_RSHUTDOWN_FUNCTION(sybase) { efree(php_sybase_module.appname); + php_sybase_module.appname = NULL; STR_FREE(php_sybase_module.server_message); + php_sybase_module.server_message = NULL; return SUCCESS; } http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.96&r2=1.97&ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.96 php-src/ext/sybase_ct/php_sybase_ct.c:1.97 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.96 Fri May 21 16:29:38 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Jul 10 03:46:08 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_ct.c,v 1.96 2004/05/21 20:29:38 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.97 2004/07/10 07:46:08 andi Exp $ */ #ifdef HAVE_CONFIG_H @@ -448,11 +448,13 @@ PHP_RSHUTDOWN_FUNCTION(sybase) { efree(SybCtG(appname)); + SybCtG(appname) = NULL; if (SybCtG(callback_name)) { zval_ptr_dtor(&SybCtG(callback_name)); SybCtG(callback_name)= NULL; } STR_FREE(SybCtG(server_message)); + SybCtG(server_message) = NULL; return SUCCESS; } http://cvs.php.net/diff.php/php-src/ext/w32api/w32api.c?r1=1.15&r2=1.16&ty=u Index: php-src/ext/w32api/w32api.c diff -u php-src/ext/w32api/w32api.c:1.15 php-src/ext/w32api/w32api.c:1.16 --- php-src/ext/w32api/w32api.c:1.15 Thu Apr 29 08:59:22 2004 +++ php-src/ext/w32api/w32api.c Sat Jul 10 03:46:09 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: w32api.c,v 1.15 2004/04/29 12:59:22 iliaa Exp $ */ +/* $Id: w32api.c,v 1.16 2004/07/10 07:46:09 andi Exp $ */ /* * Win32 API Extension for PHP @@ -287,20 +287,26 @@ */ PHP_RINIT_FUNCTION(w32api) { + HashTable *tmp; + WG(funcs) = WG(libraries) = WG(callbacks) = WG(types) = NULL; + /* Allocate Request Specific HT's here */ - ALLOC_HASHTABLE(WG(funcs)); - zend_hash_init(WG(funcs), 1, NULL, php_w32api_hash_func_dtor, 1); - - ALLOC_HASHTABLE(WG(libraries)); - zend_hash_init(WG(libraries), 1, NULL, php_w32api_hash_lib_dtor, 1); - - ALLOC_HASHTABLE(WG(callbacks)); - zend_hash_init(WG(callbacks), 1, NULL, php_w32api_hash_callback_dtor, 1); - - ALLOC_HASHTABLE(WG(types)); - zend_hash_init(WG(types), 1, NULL, php_w32api_hash_type_dtor, 1); - + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_func_dtor, 1); + WG(funcs) = tmp; + + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_lib_dtor, 1); + WG(libraries) = tmp; + + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_callback_dtor, 1); + WG(callbacks) = tmp; + + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_type_dtor, 1); + WG(types) = tmp; return SUCCESS; @@ -327,6 +333,7 @@ zend_hash_destroy(WG(types)); FREE_HASHTABLE(WG(types)); + WG(funcs) = WG(libraries) = WG(callbacks) = WG(types) = NULL; return SUCCESS; } http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.78&r2=1.79&ty=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.78 php-src/main/php_variables.c:1.79 --- php-src/main/php_variables.c:1.78 Sat Jun 26 04:09:28 2004 +++ php-src/main/php_variables.c Sat Jul 10 03:46:09 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.78 2004/06/26 08:09:28 sesser Exp $ */ +/* $Id: php_variables.c,v 1.79 2004/07/10 07:46:09 andi Exp $ */ #include <stdio.h> #include "php.h" @@ -694,9 +694,12 @@ static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC) { - ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); - array_init(PG(http_globals)[TRACK_VARS_ENV]); - INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); + zval *env_vars=NULL; + ALLOC_ZVAL(env_vars); + array_init(env_vars); + INIT_PZVAL(env_vars); + PG(http_globals)[TRACK_VARS_ENV] = env_vars; + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); zend_hash_update(&EG(symbol_table), name, name_len+1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); http://cvs.php.net/diff.php/php-src/main/rfc1867.c?r1=1.158&r2=1.159&ty=u Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.158 php-src/main/rfc1867.c:1.159 --- php-src/main/rfc1867.c:1.158 Sun May 23 06:00:59 2004 +++ php-src/main/rfc1867.c Sat Jul 10 03:46:09 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.158 2004/05/23 10:00:59 sesser Exp $ */ +/* $Id: rfc1867.c,v 1.159 2004/07/10 07:46:09 andi Exp $ */ /* * This product includes software developed by the Apache Group @@ -765,7 +765,7 @@ char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL; int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0; int max_file_size=0, skip_upload=0, anonindex=0, is_anonymous; - zval *http_post_files=NULL; + zval *http_post_files=NULL; HashTable *uploaded_files=NULL; #if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) int str_len = 0, num_vars = 0, num_vars_max = 2*10, *len_list = NULL; char **val_list = NULL; @@ -816,8 +816,9 @@ /* Initialize $_FILES[] */ zend_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0); - ALLOC_HASHTABLE(SG(rfc1867_uploaded_files)); - zend_hash_init(SG(rfc1867_uploaded_files), 5, NULL, (dtor_func_t) free_estring, 0); + ALLOC_HASHTABLE(uploaded_files); + zend_hash_init(uploaded_files, 5, NULL, (dtor_func_t) free_estring, 0); + SG(rfc1867_uploaded_files) = uploaded_files; ALLOC_ZVAL(http_post_files); array_init(http_post_files); http://cvs.php.net/diff.php/php-src/sapi/apache/mod_php5.c?r1=1.8&r2=1.9&ty=u Index: php-src/sapi/apache/mod_php5.c diff -u php-src/sapi/apache/mod_php5.c:1.8 php-src/sapi/apache/mod_php5.c:1.9 --- php-src/sapi/apache/mod_php5.c:1.8 Wed Jan 28 12:49:49 2004 +++ php-src/sapi/apache/mod_php5.c Sat Jul 10 03:46:09 2004 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php5.c,v 1.8 2004/01/28 17:49:49 rasmus Exp $ */ +/* $Id: mod_php5.c,v 1.9 2004/07/10 07:46:09 andi Exp $ */ #include "php_apache_http.h" #include "http_conf_globals.h" @@ -466,7 +466,7 @@ request_rec *r = ((request_rec *) SG(server_context)); char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); const char *authorization=NULL; - char *tmp; + char *tmp, *tmp_user; SG(request_info).query_string = r->args; SG(request_info).path_translated = r->filename; @@ -483,15 +483,16 @@ && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r))) && !strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) { tmp = uudecode(r->pool, authorization); - SG(request_info).auth_user = getword_nulls_nc(r->pool, &tmp, ':'); + SG(request_info).auth_user = NULL; + tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); if (SG(request_info).auth_user) { - r->connection->user = pstrdup(r->connection->pool, SG(request_info).auth_user); + r->connection->user = pstrdup(r->connection->pool, tmp_user); r->connection->ap_auth_type = "Basic"; - SG(request_info).auth_user = estrdup(SG(request_info).auth_user); + SG(request_info).auth_user = estrdup(tmp_user); } - SG(request_info).auth_password = tmp; - if (SG(request_info).auth_password) { - SG(request_info).auth_password = estrdup(SG(request_info).auth_password); + SG(request_info).auth_password = NULL; + if (tmp) { + SG(request_info).auth_password = estrdup(tmp); } } else { SG(request_info).auth_user = NULL; http://cvs.php.net/diff.php/php-src/sapi/apache_hooks/mod_php5.c?r1=1.2&r2=1.3&ty=u Index: php-src/sapi/apache_hooks/mod_php5.c diff -u php-src/sapi/apache_hooks/mod_php5.c:1.2 php-src/sapi/apache_hooks/mod_php5.c:1.3 --- php-src/sapi/apache_hooks/mod_php5.c:1.2 Wed Jan 28 12:59:07 2004 +++ php-src/sapi/apache_hooks/mod_php5.c Sat Jul 10 03:46:09 2004 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php5.c,v 1.2 2004/01/28 17:59:07 rasmus Exp $ */ +/* $Id: mod_php5.c,v 1.3 2004/07/10 07:46:09 andi Exp $ */ #include "php_apache_http.h" @@ -564,7 +564,7 @@ request_rec *r = ((request_rec *) SG(server_context)); char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); const char *authorization=NULL; - char *tmp; + char *tmp, *tmp_user; SG(request_info).query_string = r->args; SG(request_info).path_translated = r->filename; @@ -581,15 +581,16 @@ && !auth_type(r) && !strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) { tmp = uudecode(r->pool, authorization); - SG(request_info).auth_user = getword_nulls_nc(r->pool, &tmp, ':'); + SG(request_info).auth_user = NULL; + tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); if (SG(request_info).auth_user) { - r->connection->user = pstrdup(r->connection->pool, SG(request_info).auth_user); + r->connection->user = pstrdup(r->connection->pool, tmp_user); r->connection->ap_auth_type = "Basic"; - SG(request_info).auth_user = estrdup(SG(request_info).auth_user); + SG(request_info).auth_user = estrdup(tmp_user); } - SG(request_info).auth_password = tmp; - if (SG(request_info).auth_password) { - SG(request_info).auth_password = estrdup(SG(request_info).auth_password); + SG(request_info).auth_password = NULL; + if (tmp) { + SG(request_info).auth_password = estrdup(tmp); } } else { SG(request_info).auth_user = NULL;
« previous php.cvs (#27777) next »