Diff for /embedaddon/php/ext/session/mod_user.c between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2012/02/21 23:48:01 version 1.1.1.3, 2013/07/22 01:32:00
Line 2 Line 2
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | PHP Version 5                                                        |     | PHP Version 5                                                        |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
   | Copyright (c) 1997-2012 The PHP Group                                |   | Copyright (c) 1997-2013 The PHP Group                                |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | This source file is subject to version 3.01 of the PHP license,      |     | This source file is subject to version 3.01 of the PHP license,      |
    | that is bundled with this package in the file LICENSE, and is        |     | that is bundled with this package in the file LICENSE, and is        |
Line 62  static zval *ps_call_handler(zval *func, int argc, zva Line 62  static zval *ps_call_handler(zval *func, int argc, zva
         return retval;          return retval;
 }  }
   
#define STDVARS1                                                        \#define STDVARS                                                         \
        zval *retval;                                                       \        zval *retval = NULL;                                       \
         int ret = FAILURE          int ret = FAILURE
   
 #define STDVARS                                                         \  
         STDVARS1;                                                               \  
         char *mdata = PS_GET_MOD_DATA();                \  
         if (!mdata) { return FAILURE; }  
   
 #define PSF(a) PS(mod_user_names).name.ps_##a  #define PSF(a) PS(mod_user_names).name.ps_##a
   
 #define FINISH                                                          \  #define FINISH                                                          \
Line 84  static zval *ps_call_handler(zval *func, int argc, zva Line 79  static zval *ps_call_handler(zval *func, int argc, zva
 PS_OPEN_FUNC(user)  PS_OPEN_FUNC(user)
 {  {
         zval *args[2];          zval *args[2];
        static char dummy = 0;        STDVARS;
        STDVARS1;        
         if (PSF(open) == NULL) {
                 php_error_docref(NULL TSRMLS_CC, E_WARNING,
                         "user session functions not defined");
                         
                 return FAILURE;
         }
   
         SESS_ZVAL_STRING((char*)save_path, args[0]);          SESS_ZVAL_STRING((char*)save_path, args[0]);
         SESS_ZVAL_STRING((char*)session_name, args[1]);          SESS_ZVAL_STRING((char*)session_name, args[1]);
   
         retval = ps_call_handler(PSF(open), 2, args TSRMLS_CC);          retval = ps_call_handler(PSF(open), 2, args TSRMLS_CC);
        if (retval) {        PS(mod_user_implemented) = 1;
                /* This is necessary to fool the session module. Yes, it's safe to 
                 * use a static. Neither mod_user nor the session module itself will 
                 * ever touch this pointer. It could be set to 0xDEADBEEF for all the 
                 * difference it makes, but for the sake of paranoia it's set to some 
                 * valid value. */ 
                PS_SET_MOD_DATA(&dummy); 
        } 
   
         FINISH;          FINISH;
 }  }
   
 PS_CLOSE_FUNC(user)  PS_CLOSE_FUNC(user)
 {  {
        STDVARS1;        zend_bool bailout = 0;
         STDVARS;
   
        retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC);        if (!PS(mod_user_implemented)) {
                 /* already closed */
                 return SUCCESS;
         }
   
        PS_SET_MOD_DATA(NULL);        zend_try {
                 retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC);
         } zend_catch {
                 bailout = 1;
         } zend_end_try();
 
         PS(mod_user_implemented) = 0;
 
         if (bailout) {
                 if (retval) {
                         zval_ptr_dtor(&retval);
                 }
                 zend_bailout();
         }
   
         FINISH;          FINISH;
 }  }

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>