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

version 1.1.1.1, 2012/02/21 23:48:01 version 1.1.1.2, 2012/05/29 12:34:42
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;                                                   \
         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;        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);        retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC);
         PS(mod_user_implemented) = 0;
   
         FINISH;          FINISH;
 }  }

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


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