cvs: php4 /ext/session mod_mm.c

From: Date: Thu, 10 Jan 2002 06:14:40 +0000
Subject: cvs: php4 /ext/session mod_mm.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9016@lists.php.net to get a copy of this message
yohgaki Thu Jan 10 01:14:40 2002 EDT Modified files: /php4/ext/session mod_mm.c Log: Make use of save_path for mm file. Patch by Henning Schmiedehausen <hps@intermeta.de> Closes bug 14808 Index: php4/ext/session/mod_mm.c diff -u php4/ext/session/mod_mm.c:1.25 php4/ext/session/mod_mm.c:1.26 --- php4/ext/session/mod_mm.c:1.25 Tue Dec 11 10:30:21 2001 +++ php4/ext/session/mod_mm.c Thu Jan 10 01:14:40 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mod_mm.c,v 1.25 2001/12/11 15:30:21 sebastian Exp $ */ +/* $Id: mod_mm.c,v 1.26 2002/01/10 06:14:40 yohgaki Exp $ */ #include "php.h" @@ -35,7 +35,7 @@ # error mm is not thread-safe #endif -#define PS_MM_PATH "/tmp/session_mm" +#define PS_MM_FILE "session_mm" /* For php_uint32 */ #include "ext/standard/basic_functions.h" @@ -247,8 +247,18 @@ PHP_MINIT_FUNCTION(ps_mm) { + char *ps_mm_path = calloc(strlen(PS(save_path))+1+strlen(PS_MM_FILE)+1, 1); /* Directory + '/' + File + \0 */ + ps_mm_instance = calloc(sizeof(*ps_mm_instance), 1); - if (ps_mm_initialize(ps_mm_instance, PS_MM_PATH) != SUCCESS) { + + strcpy(ps_mm_path, PS(save_path)); + + if((strlen(ps_mm_path) > 0) && (ps_mm_path[strlen(ps_mm_path)-1] != '/')) + strcat(ps_mm_path, "/"); /* Fixme Windows */ + + strcat(ps_mm_path, PS_MM_FILE); + + if (ps_mm_initialize(ps_mm_instance, ps_mm_path) != SUCCESS) { ps_mm_instance = NULL; return FAILURE; }

« previous php.cvs (#9016) next »