diff options
| author | Yasuo Ohgaki <yohgaki@php.net> | 2002-02-03 05:40:19 +0000 |
|---|---|---|
| committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-02-03 05:40:19 +0000 |
| commit | bd32363e2f632a44d2a2e0e8f326c4cb6cfaee89 (patch) | |
| tree | dbcb386a3ff638e12a87576d8792951d6c93465c /ext/session/session.c | |
| parent | 4c6e58ac597be7565bd8715520e28a35f9dd2931 (diff) | |
| download | php-git-bd32363e2f632a44d2a2e0e8f326c4cb6cfaee89.tar.gz | |
Revert last commit. Last patch has problem for the 1st request.
# I also found what's wrong in mod_mm.c :)
# I'll fix it later since don't have much time now.
Diffstat (limited to 'ext/session/session.c')
| -rw-r--r-- | ext/session/session.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index 0594d916c1..69836bff53 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -543,21 +543,19 @@ static char *_php_create_id(int *newlen TSRMLS_DC) return estrdup(buf); } -static int php_session_initialize(TSRMLS_D) +static void php_session_initialize(TSRMLS_D) { char *val; int vallen; if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) { php_error(E_ERROR, "Failed to initialize session module"); - return FAILURE; + return; } - if (PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen) == FAILURE) { - return FAILURE; + if (PS(mod)->read(&PS(mod_data), PS(id), &val, &vallen) == SUCCESS) { + php_session_decode(val, vallen TSRMLS_CC); + efree(val); } - php_session_decode(val, vallen TSRMLS_CC); - efree(val); - return SUCCESS; } @@ -948,10 +946,11 @@ static void php_session_start(TSRMLS_D) } php_session_cache_limiter(TSRMLS_C); - if (php_session_initialize(TSRMLS_C) == SUCCESS && - PS(mod_data) && PS(gc_probability) > 0) { + php_session_initialize(TSRMLS_C); + + if (PS(mod_data) && PS(gc_probability) > 0) { int nrdels = -1; - + nrand = (int) (100.0*php_combined_lcg(TSRMLS_C)); if (nrand < PS(gc_probability)) { PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels); @@ -963,7 +962,6 @@ static void php_session_start(TSRMLS_D) } } - static zend_bool php_session_destroy(TSRMLS_D) { zend_bool retval = SUCCESS; |
