summaryrefslogtreecommitdiff
path: root/ext/session/mod_user.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-10-11 19:47:15 +0000
committerSascha Schumann <sas@php.net>2000-10-11 19:47:15 +0000
commitd2d5320ee8fac3a3bb56deda264e811f7c7e3106 (patch)
tree3038664287f815d56eb012e8ba383ca5d4290646 /ext/session/mod_user.c
parent0fd6a7ed18fc23c3b90175da5167ed8d6af9e3aa (diff)
downloadphp-git-d2d5320ee8fac3a3bb56deda264e811f7c7e3106.tar.gz
Add session_write_close(). This is primarily intended to enable
script writers to release the lock associated with the session lock before the request finishes. You can pass arrays now to session_set_save_handler(), so that the handlers can be located in an object for better abstraction.
Diffstat (limited to 'ext/session/mod_user.c')
-rw-r--r--ext/session/mod_user.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index d0bf39205e..efb52070d2 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -49,26 +49,18 @@ ps_module ps_mod_user = {
}
-static zval *ps_call_handler(char *name, int argc, zval **argv)
+static zval *ps_call_handler(zval *func, int argc, zval **argv)
{
int i;
zval *retval = NULL;
ELS_FETCH();
- if (name && name[0] != '\0') {
- zval *func;
-
- SESS_ZVAL_STRING(name, func);
- MAKE_STD_ZVAL(retval);
-
- if (call_user_function(EG(function_table), NULL, func, retval,
- argc, argv) == FAILURE) {
- zval_dtor(retval);
- efree(retval);
- retval = NULL;
- }
- zval_dtor(func);
- efree(func);
+ MAKE_STD_ZVAL(retval);
+ if (call_user_function(EG(function_table), NULL, func, retval,
+ argc, argv) == FAILURE) {
+ zval_dtor(retval);
+ efree(retval);
+ retval = NULL;
}
for (i = 0; i < argc; i++) {
@@ -118,7 +110,7 @@ PS_CLOSE_FUNC(user)
retval = ps_call_handler(PSF(close), 0, NULL);
for (i = 0; i < 6; i++)
- efree(mdata->names[i]);
+ zval_del_ref(&mdata->names[i]);
efree(mdata);
PS_SET_MOD_DATA(NULL);