Shouldn't this be MFH'd to the PHP_4_3 branch too?
Looks like a fix to me.. :)
--Jani
On Tue, 11 Feb 2003, Sascha Schumann wrote:
>sas Mon Feb 10 19:42:14 2003 EDT
>
> Modified files:
> /php4/ext/session session.c php_session.h
> Log:
> use appropiate prefixes in the ps_module structure so we don't clash
> with syscalls
>
>
>Index: php4/ext/session/session.c
>diff -u php4/ext/session/session.c:1.350 php4/ext/session/session.c:1.351
>--- php4/ext/session/session.c:1.350 Thu Jan 30 17:37:50 2003
>+++ php4/ext/session/session.c Mon Feb 10 19:42:14 2003
>@@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
>-/* $Id: session.c,v 1.350 2003/01/30 22:37:50 iliaa Exp $ */
>+/* $Id: session.c,v 1.351 2003/02/11 00:42:14 sas Exp $ */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
>@@ -696,14 +696,14 @@
> }
>
> /* Open session handler first */
>- if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) ==
>FAILURE) {
>+ if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC)
>== FAILURE) {
> php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize
>session module");
> return;
> }
>
> /* If there is no ID, use session module to create one */
> if (!PS(id))
>- PS(id) = PS(mod)->create_sid(&PS(mod_data), NULL TSRMLS_CC);
>+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
>
> /* Read data */
> /* Question: if you create a SID here, should you also try to read data?
>@@ -712,7 +712,7 @@
> * session information
> */
> php_session_track_init(TSRMLS_C);
>- if (PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) {
>+ if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) ==
>SUCCESS) {
> php_session_decode(val, vallen TSRMLS_CC);
> efree(val);
> }
>@@ -780,10 +780,10 @@
>
> val = php_session_encode(&vallen TSRMLS_CC);
> if (val) {
>- ret = PS(mod)->write(&PS(mod_data), PS(id), val,
>vallen TSRMLS_CC);
>+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), val,
>vallen TSRMLS_CC);
> efree(val);
> } else {
>- ret = PS(mod)->write(&PS(mod_data), PS(id), "", 0
>TSRMLS_CC);
>+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0
>TSRMLS_CC);
> }
> }
>
>@@ -791,12 +791,12 @@
> 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,
>+ PS(mod)->s_name,
> PS(save_path));
> }
>
> if (PS(mod_data))
>- PS(mod)->close(&PS(mod_data) TSRMLS_CC);
>+ PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
> }
>
> static char *month_names[] = {
>@@ -991,7 +991,7 @@
> int i;
>
> for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++)
>- if (*mod && !strcasecmp(name, (*mod)->name)) {
>+ if (*mod && !strcasecmp(name, (*mod)->s_name)) {
> ret = *mod;
> break;
> }
>@@ -1147,7 +1147,7 @@
>
> nrand = (int) ((float) PS(gc_dividend) * php_combined_lcg(TSRMLS_C));
> if (nrand < PS(gc_probability)) {
>- PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels
>TSRMLS_CC);
>+ PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels
>TSRMLS_CC);
> #if 0
> if (nrdels != -1)
> php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d
>expired session objects\n", nrdels);
>@@ -1165,7 +1165,7 @@
> return FAILURE;
> }
>
>- if (PS(mod)->destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
>+ if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
> retval = FAILURE;
> php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object
>destruction failed");
> }
>@@ -1259,7 +1259,7 @@
> if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
> WRONG_PARAM_COUNT;
>
>- old = safe_estrdup(PS(mod)->name);
>+ old = safe_estrdup(PS(mod)->s_name);
>
> if (ac == 1) {
> ps_module *tempmod;
>@@ -1268,7 +1268,7 @@
> tempmod = _php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC);
> if (tempmod) {
> if (PS(mod_data))
>- PS(mod)->close(&PS(mod_data) TSRMLS_CC);
>+ PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
> PS(mod) = tempmod;
> PS(mod_data) = NULL;
> } else {
>@@ -1621,7 +1621,7 @@
> static void php_rshutdown_session_globals(TSRMLS_D)
> {
> if (PS(mod_data)) {
>- PS(mod)->close(&PS(mod_data) TSRMLS_CC);
>+ PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
> }
> if (PS(id)) {
> efree(PS(id));
>@@ -1720,8 +1720,8 @@
> int i;
>
> for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) {
>- if (*mod && (*mod)->name) {
>- smart_str_appends(&handlers, (*mod)->name);
>+ if (*mod && (*mod)->s_name) {
>+ smart_str_appends(&handlers, (*mod)->s_name);
> smart_str_appendc(&handlers, ' ');
> }
> }
>Index: php4/ext/session/php_session.h
>diff -u php4/ext/session/php_session.h:1.87 php4/ext/session/php_session.h:1.88
>--- php4/ext/session/php_session.h:1.87 Thu Jan 16 02:21:49 2003
>+++ php4/ext/session/php_session.h Mon Feb 10 19:42:14 2003
>@@ -35,14 +35,14 @@
> char *php_session_create_id(PS_CREATE_SID_ARGS);
>
> typedef struct ps_module_struct {
>- const char *name;
>- int (*open)(PS_OPEN_ARGS);
>- int (*close)(PS_CLOSE_ARGS);
>- int (*read)(PS_READ_ARGS);
>- int (*write)(PS_WRITE_ARGS);
>- int (*destroy)(PS_DESTROY_ARGS);
>- int (*gc)(PS_GC_ARGS);
>- char *(*create_sid)(PS_CREATE_SID_ARGS);
>+ const char *s_name;
>+ int (*s_open)(PS_OPEN_ARGS);
>+ int (*s_close)(PS_CLOSE_ARGS);
>+ int (*s_read)(PS_READ_ARGS);
>+ int (*s_write)(PS_WRITE_ARGS);
>+ int (*s_destroy)(PS_DESTROY_ARGS);
>+ int (*s_gc)(PS_GC_ARGS);
>+ char *(*s_create_sid)(PS_CREATE_SID_ARGS);
> } ps_module;
>
> #define PS_GET_MOD_DATA() *mod_data
>
>
>
>
--
<- For Sale! ->
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php