Update of /cvsroot/phplib/php-lib/php
In directory usw-pr-cvs1:/tmp/cvs-serv1001
Modified Files:
ct_shm.inc
Log Message:
bug ID 460338: string comparison of integer value
caused bogus session removal once every 30 years.
Index: ct_shm.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib/php/ct_shm.inc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ct_shm.inc 13 Apr 2000 13:28:45 -0000 1.6
--- ct_shm.inc 10 Aug 2002 00:54:11 -0000 1.7
***************
*** 63,72 ****
function ac_gc($gc_time, $name) {
$cmp = time() - $gc_time * 60;
! for($i = 1; $i <= $this->max_sessions; $i++)
if(($val = @shm_get_var($this->shmid, $i)) != false) {
$dat = explode(";", $val);
! if($name == $dat[1] && strcmp($dat[3], $cmp) < 0)
shm_remove_var($this->shmid, $i);
}
}
--- 63,74 ----
function ac_gc($gc_time, $name) {
$cmp = time() - $gc_time * 60;
! for($i = 1; $i <= $this->max_sessions; $i++) {
if(($val = @shm_get_var($this->shmid, $i)) != false) {
$dat = explode(";", $val);
! if($name == $dat[1] && intval($dat[3]) < $cmp) {
shm_remove_var($this->shmid, $i);
+ }
}
+ }
}
|