]> granicus.if.org Git - php/commitdiff
Return SUCCESS from write handler, if vallen is 0.
authorSascha Schumann <sas@php.net>
Fri, 29 Sep 2000 21:44:45 +0000 (21:44 +0000)
committerSascha Schumann <sas@php.net>
Fri, 29 Sep 2000 21:44:45 +0000 (21:44 +0000)
Submitted by: tcarroll@chc-chimes.com
PR: #6958

ext/session/mod_mm.c

index c8d4e374e30bb5b9c466cb80947fdaf4eff55d3b..7255165e32513b5050aedcb173b9a0a7563fe78b 100644 (file)
@@ -117,7 +117,7 @@ static ps_sd *ps_sd_new(ps_mm *data, const char *key, const void *sdata, size_t
                sd->next->prev = sd;
        sd->prev = NULL;
        
-       ps_mm_debug("inserting %s(%x) into %d\n", key, sd, h);
+       ps_mm_debug("inserting %s(%p) into %d\n", key, sd, h);
        
        data->hash[h] = sd;
 
@@ -162,7 +162,7 @@ static ps_sd *ps_sd_lookup(ps_mm *data, const char *key, int rw)
                ps_mm_debug("optimizing\n");
        }
 
-       ps_mm_debug(stderr, "lookup(%s): ret=%x,h=%d\n", key, ret, h);
+       ps_mm_debug(stderr, "lookup(%s): ret=%p,h=%d\n", key, ret, h);
        
        return ret;
 }
@@ -213,7 +213,7 @@ PHP_GSHUTDOWN_FUNCTION(ps_mm)
 
 PS_OPEN_FUNC(mm)
 {
-       ps_mm_debug("open: ps_mm_instance=%x\n", ps_mm_instance);
+       ps_mm_debug("open: ps_mm_instance=%p\n", ps_mm_instance);
        
        if (!ps_mm_instance)
                return FAILURE;
@@ -256,6 +256,8 @@ PS_WRITE_FUNC(mm)
        PS_MM_DATA;
        ps_sd *sd;
 
+       if (vallen == 0) return SUCCESS;
+       
        mm_lock(data->mm, MM_LOCK_RW);
 
        sd = ps_sd_lookup(data, key, 1);