Skip Menu |

This queue is for tickets about the Apache-Session CPAN distribution.

Report information
The Basics
Id: 18795
Status: resolved
Priority: 0/
Queue: Apache-Session

People
Owner: Nobody in particular
Requestors: chorny [...] mail.ru
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.80
Fixed in: 1.81_01



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
Download corrected_versions.rar
application/x-rar-compressed 2.5k

Message body not shown because it is not plain text.

Subject: Version 2 of patches
From: Alexandr Ciornii <alexchorny [...] gmail.com>
Now handles Cygwin as well, added documentation. Not changed for 1.81. Win32 version of this module for Perl 5.8 is available at http://chorny.net/perlmod/ ------- Alexandr Ciornii, http://chorny.net
Download version2.zip
application/x-zip-compressed 3k

Message body not shown because it is not plain text.

Integrated myself in 1.81_01. -- Alexandr Ciornii, http://chorny.net