sas             Thu Oct  3 01:53:45 2002 EDT

  Modified files:              
    /php4/ext/session   session.c 
  Log:
  (track_init) Use is_ref/refcount parameters of SET_SYMBOL macros
  
  (save_current_state) Prevent a possible deadlock which occurs when 
  the track vars are inaccessible
  
  
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.326 php4/ext/session/session.c:1.327
--- php4/ext/session/session.c:1.326    Thu Oct  3 00:53:05 2002
+++ php4/ext/session/session.c  Thu Oct  3 01:53:45 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: session.c,v 1.326 2002/10/03 04:53:05 sas Exp $ */
+/* $Id: session.c,v 1.327 2002/10/03 05:53:45 sas Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -499,9 +499,9 @@
 
        MAKE_STD_ZVAL(PS(http_session_vars));
        array_init(PS(http_session_vars));
-               
-       ZEND_SET_GLOBAL_VAR("HTTP_SESSION_VARS", PS(http_session_vars));
-       ZEND_SET_GLOBAL_VAR("_SESSION", PS(http_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);
 }
 
 static char *php_session_encode(int *newlen TSRMLS_DC)
@@ -662,30 +662,27 @@
                                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.");
                        }
                }
-       } else {
-               return;
-       }
 
-       if (PS(mod_data)) {
-               char *val;
-               int vallen;
-
-               val = php_session_encode(&vallen TSRMLS_CC);
-               if (val) {
-                       ret = PS(mod)->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);
+               if (PS(mod_data)) {
+                       char *val;
+                       int vallen;
+
+                       val = php_session_encode(&vallen TSRMLS_CC);
+                       if (val) {
+                               ret = PS(mod)->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);
+                       }
                }
+
+               if (ret == FAILURE)
+                       php_error(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(save_path));
        }
-       
-       if (ret == FAILURE)
-               php_error(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(save_path));
-       
        
        if (PS(mod_data))
                PS(mod)->close(&PS(mod_data) TSRMLS_CC);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to