cvs: php4(PHP_4_3) /ext/session mod_files.c mod_mm.c session.c

From: Date: Thu, 05 Dec 2002 20:14:10 +0000
Subject: cvs: php4(PHP_4_3) /ext/session mod_files.c mod_mm.c session.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-16944@lists.php.net to get a copy of this message
helly Thu Dec 5 15:14:10 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/session mod_files.c mod_mm.c session.c Log: MFH

Index: php4/ext/session/mod_files.c diff -u php4/ext/session/mod_files.c:1.83 php4/ext/session/mod_files.c:1.83.2.1 --- php4/ext/session/mod_files.c:1.83 Wed Oct 2 02:05:16 2002 +++ php4/ext/session/mod_files.c Thu Dec 5 15:14:09 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mod_files.c,v 1.83 2002/10/02 06:05:16 sas Exp $ */ +/* $Id: mod_files.c,v 1.83.2.1 2002/12/05 20:14:09 helly Exp $ */ #include "php.h" @@ -142,7 +142,7 @@ ps_files_close(data); if (!ps_files_valid_key(key)) { - php_error(E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9"); return; } if (!ps_files_path_create(buf, sizeof(buf), data, key)) @@ -157,11 +157,11 @@ #ifdef F_SETFD if (fcntl(data->fd, F_SETFD, 1)) { - php_error(E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno); } #endif } else { - php_error(E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, + php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno); } } @@ -180,7 +180,7 @@ dir = opendir(dirname); if (!dir) { - php_error(E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno); return (0); } @@ -280,9 +280,9 @@ if (n != sbuf.st_size) { if (n == -1) - php_error(E_WARNING, "read failed: %s (%d)", strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s (%d)", strerror(errno), errno); else - php_error(E_WARNING, "read returned less bytes than requested"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "read returned less bytes than requested"); efree(*val); return FAILURE; } @@ -316,9 +316,9 @@ if (n != vallen) { if (n == -1) - php_error(E_WARNING, "write failed: %s (%d)", strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "write failed: %s (%d)", strerror(errno), errno); else - php_error(E_WARNING, "write wrote less bytes than requested"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "write wrote less bytes than requested"); return FAILURE; } Index: php4/ext/session/mod_mm.c diff -u php4/ext/session/mod_mm.c:1.39 php4/ext/session/mod_mm.c:1.39.4.1 --- php4/ext/session/mod_mm.c:1.39 Thu Jun 27 22:27:02 2002 +++ php4/ext/session/mod_mm.c Thu Dec 5 15:14:09 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mod_mm.c,v 1.39 2002/06/28 02:27:02 sniper Exp $ */ +/* $Id: mod_mm.c,v 1.39.4.1 2002/12/05 20:14:09 helly Exp $ */ #include "php.h" @@ -124,7 +124,9 @@ sd = mm_malloc(data->mm, sizeof(ps_sd) + keylen); if (!sd) { - php_error(E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm_error()); + TSRMlS_FETCH(); + + php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm_error()); return NULL; } @@ -359,7 +361,7 @@ if (!sd->data) { ps_sd_destroy(data, sd); - php_error(E_WARNING, "cannot allocate new data segment"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot allocate new data segment"); sd = NULL; } } Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.336.2.1 php4/ext/session/session.c:1.336.2.2 --- php4/ext/session/session.c:1.336.2.1 Wed Nov 20 12:49:57 2002 +++ php4/ext/session/session.c Thu Dec 5 15:14:09 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.336.2.1 2002/11/20 17:49:57 derick Exp $ */ +/* $Id: session.c,v 1.336.2.2 2002/12/05 20:14:09 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -86,7 +86,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) { if (PS(session_status) == php_session_active) { - php_error(E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); return FAILURE; } PS(mod) = _php_find_ps_module(new_value TSRMLS_CC); @@ -98,7 +98,7 @@ #if 0 if(!PS(mod)) { - php_error(E_ERROR,"Cannot find save handler %s",new_value); + php_error_docref(E_ERROR, "Cannot find save handler %s", new_value); } #endif return SUCCESS; @@ -107,7 +107,7 @@ static PHP_INI_MH(OnUpdateSerializer) { if (PS(session_status) == php_session_active) { - php_error(E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); return FAILURE; } PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC); @@ -119,7 +119,7 @@ #if 0 if(!PS(serializer)) { - php_error(E_ERROR,"Cannot find serialization handler %s",new_value); + php_error_docref(E_ERROR, "Cannot find serialization handler %s", new_value); } #endif return SUCCESS; @@ -531,7 +531,7 @@ { if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) { php_session_destroy(TSRMLS_C); - php_error(E_WARNING, "Failed to decode session object. Session has been destroyed."); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed."); } } @@ -598,7 +598,7 @@ /* Open session handler first */ if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) { - php_error(E_ERROR, "Failed to initialize session module"); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize session module"); return; } @@ -639,7 +639,7 @@ } break; case HASH_KEY_IS_LONG: - php_error(E_NOTICE, "The session bug compatibility code will not " + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The session bug compatibility code will not " "try to locate the global variable $%d due to its " "numeric nature.", num_key); break; @@ -671,7 +671,7 @@ } if (do_warn && PS(bug_compat_warn)) { - php_error(E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively."); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively."); } } @@ -689,7 +689,7 @@ } if (ret == FAILURE) - php_error(E_WARNING, "Failed to write session data (%s). Please " + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please " "verify that the current setting of session.save_path " "is correct (%s)", PS(mod)->name, @@ -808,10 +808,10 @@ int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { - php_error(E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", output_start_filename, output_start_lineno); } else { - php_error(E_WARNING, "Cannot send session cache limiter - headers already sent"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent"); } return -2; } @@ -842,10 +842,10 @@ int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { - php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", output_start_filename, output_start_lineno); } else { - php_error(E_WARNING, "Cannot send session cookie - headers already sent"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent"); } return; } @@ -1051,7 +1051,7 @@ PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC); #if 0 if (nrdels != -1) - php_error(E_NOTICE, "purged %d expired session objects\n", nrdels); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects\n", nrdels); #endif } } @@ -1062,13 +1062,13 @@ zend_bool retval = SUCCESS; if (PS(session_status) != php_session_active) { - php_error(E_WARNING, "Trying to destroy uninitialized session"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session"); return FAILURE; } if (PS(mod)->destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { retval = FAILURE; - php_error(E_WARNING, "Session object destruction failed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed"); } php_rshutdown_session_globals(TSRMLS_C); @@ -1119,7 +1119,7 @@ } if (array_init(return_value) == FAILURE) { - php_error(E_ERROR, "Cannot initialize return value from session_get_cookie_parameters"); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot initialize return value from session_get_cookie_parameters"); RETURN_FALSE; } @@ -1177,7 +1177,7 @@ PS(mod_data) = NULL; } else { efree(old); - php_error(E_ERROR, "Cannot find named PHP session module (%s)", + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find named PHP session module (%s)", Z_STRVAL_PP(p_name)); RETURN_FALSE; }
« previous php.cvs (#16944) next »