Subject: | several bugs with patches |
Apache::Session test '99dbfile.t' fails under MS Win XP, because Windows
considers two
locks from same process as different locks. I discovered this with small
test:
#!perl -w
use strict;
use Fcntl qw(:flock);
print "OS: '$^O'\n";
open A,'>testfile';
flock(A, LOCK_SH);
flock(A, LOCK_EX) or die;
Quick solution is to replace in Apache::Session::Lock::File:
sub acquire_read_lock {
my $self = shift;
my $session = shift;
with
sub acquire_read_lock {
if ($^O eq 'MSWin32') {
#Windows cannot escalate lock, so all locks will be exclusive
return &acquire_write_lock;
}
my $self = shift;
my $session = shift;
Although this will make all locks exclusive.
Windows cannot unlink file that is still open so I changed in sub clean
in Apache::Session::Lock::File:
open(FH, "+>$dir/".$file) || next;
flock(FH, LOCK_EX) || next;
unlink($dir.'/'.$file) || next;
flock(FH, LOCK_UN);
close(FH);
to
if ($^O eq 'MSWin32') {
#Windows cannot unlink opened file
unlink($dir.'/'.$file) || next;
} else {
open(FH, "+>$dir/".$file) || next;
flock(FH, LOCK_EX) || next;
unlink($dir.'/'.$file) || next;
flock(FH, LOCK_UN);
close(FH);
}
test '99semaphore.t' fails if IPC::SysV is not present. Solution: replace
plan skip_all => "Optional modules (IPC::SysV, IPC::Semaphore) not
installed"
unless eval {
require IPC::SysV;
require IPC::Semaphore;
};
with
BEGIN {
plan skip_all => "Optional modules (IPC::SysV, IPC::Semaphore) not
installed"
unless eval {
require IPC::SysV;
require IPC::Semaphore;
};
}
Attached '99semaphore.t' is also modified with patch from Bug 16539.
Minor error: Apache::Session::Lock::File has word "THis".
Minor error: README has sentence "This is Apache::Session 1.6".
Makefile.PL does not have author & abstract information. Adding this
will allow
more informative ppd (for ActiveState Perl) files.
This should be added to WriteMakefile call
AUTHOR => 'Casey West <casey[at]geeknest.com>',
ABSTRACT => 'A persistence framework for session data',
Subject: | corrected_versions.rar |
Message body not shown because it is not plain text.