You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Iwan Garnadi <su...@yahoo.com> on 2001/06/27 23:50:16 UTC

where to report apache::session 1.53 bug ?

I don't know where to report apache::session bug , because I sent to the
author , I didn't get any reply yet



Re: where to report apache::session 1.53 bug ?

Posted by Vivek Khera <kh...@kcilink.com>.
>>>>> "GB" == Gunther Birznieks <gu...@extropia.com> writes:

GB> Most of the time it is really bad to email open source authors
GB> directly.
[ .. ]

GB> That's the job of open forums like this. So the author continues time
GB> to write new updates while the forums basically run themselves with
GB> other people sharing ideas and support.

Then the author should state where to get help, like I do in my
modules.  If not, then I would not necessarily know what the correct
forum for assistance is, would you?

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

Re: where to report apache::session 1.53 bug ?

Posted by Gunther Birznieks <gu...@extropia.com>.
Most of the time it is really bad to email open source authors directly.

They released a piece of software out of kindness. But hey, it's open 
source and they can't hold up the entire world of support like an Atlas, 24x7.

That's the job of open forums like this. So the author continues time to 
write new updates while the forums basically run themselves with other 
people sharing ideas and support.

At 04:50 AM 6/28/01 +0700, Iwan Garnadi wrote:
>I don't know where to report apache::session bug , because I sent to the
>author , I didn't get any reply yet

__________________________________________________
Gunther Birznieks (gunther.birznieks@eXtropia.com)
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/


Re: where to report apache::session 1.53 bug ?

Posted by Tatsuhiko Miyagawa <mi...@edge.co.jp>.
Hi,

Here are patches I've made ages ago.
http://bulknews.net/lib/archives/Apache-Session-File.pm.patch
http://bulknews.net/lib/archives/Apache-Session-Flex.pm.patch

Thanks

On Thu, 28 Jun 2001 19:15:33 +0700
"Iwan Garnadi" <su...@yahoo.com> wrote:

> 
> BUG :
> 1. Flex , using Apache::Session::File
> bug in Apache::Session
> TIEHASH method for validate attribute in line 379 :
> &{$self->{validate}}($self);
> I am just commented this to get by pass the error !

--
Tatsuhiko Miyagawa           Livin' On The EDGE, Co.,Ltd.
mailto:miyagawa@edge.co.jp         http://www.edge.co.jp/


Re: where to report apache::session 1.53 bug ?

Posted by Iwan Garnadi <su...@yahoo.com>.
in Apache::Session ver 1.53

BUG :
1. Flex , using Apache::Session::File
bug in Apache::Session
TIEHASH method for validate attribute in line 379 :
&{$self->{validate}}($self);
I am just commented this to get by pass the error !

this is below sample of code that cause error :
( Would be in the below of this email )

and error that is shown :
 Global data is not accessible : Can't use string ("") as a subroutine ref
while "strict refs" in use at
/usr/lib/perl5/site_perl/5.005/Apache/Session.pm line 379


2. Apache::Session::Lock::File , clean method got bug in Line 136 !
it is written :
# This would be imposible to clean out lock file that is older than
....second  !!!
if ((stat($dir.'/'.$file))[8] - $now >= $time)

 # bla bla bla
}

it suppose to be :
if ( $now - (stat($dir.'/'.$file))[8] >= $time) {
 # bla bla bla
}


CONFIRMATION : ( I am not sure)
1. Apache::Session::Store::File , "seem" doesn't implement locking method
like flock in Apache::Session::Lock::File
when doing "update" an "reading"
How to handle with user that is "opening another browser new windows" and do
the same update ( concurency problem ) !
NB : I maybe wrong in this because I don't read all the source code

Question : I just need to confirm is Apache::Session::File is safe in
concurency problem above ?


SUGGESTION :
1. Apache::Session should implement clean method just like in
Apache::Session::Lock::File, but this time is clean method for "unused
session data"
Because lot of people when doing shopping cart or login session usually
don't
do "sign out" or something like that ........
it means impossible to do 'tied(%obj)->delete;' normally in program which
cause session data file like '7bf6117c473f77e791eb33213012d538' still left
in
/tmp/sessiondata !!
this means :
 a. wasting space
 b. slowing down processing in Apache::Session::File etc
I suggest name of method like 'clean_unused_data'


QUESTION :
1. how to implement suggestion number 1 in Apache::Session::File ?
 because I so need this feature immediately ?
 can you give me a quick code for this ?

 or is it safe just doing this code ?

sub clean_unused_data {
    my $dir  = shift;
    my $time = shift;

    my $now = time();

    opendir(DIR, $dir) || die $!;
    my @files = readdir(DIR);
    foreach my $file (@files) {
        if ($file =~ /^[a-fA-F0-9]+$/) {
            if ( $now - (stat($dir.'/'.$file))[8] >= $time) {
                unlink($dir.'/'.$file) || next;
            }
        }
    }
}



Thanks Jeffry
sorry if my english is so poor

=== sample script that is error ======

#!/usr/bin/perl

use Apache::Session::Flex;
use CGI;
use CGI::Carp qw(fatalsToBrowser);;
use Data::Dumper;
use Carp;

#local $| = 1;

my $q = CGI->new;

my ( %session , );
my $cookie_name = 'asid';

my $sid = $q->cookie($cookie_name);
chomp $sid;
print STDERR "[" , scalar localtime , "]\$sid : $sid\n";
my $session_data_directory = '/home/auction/tmp/session';

eval {
 tie %session , 'Apache::Session::Flex', $sid ,
  {
  Store     => 'File',
  Lock      => 'Null',
  Generate  => 'MD5',
  Serialize => 'Base64' ,

  Directory     => $session_data_directory ,
  LockDirectory => '/home/auction/tmp/session.lock' ,
  #Transaction   => 1 ,
  }
 ;
};
if ($@) { confess "Global data is not accessible : $@"; }


if ($sid) {
 print $q->header;
 print "now asid cookie value : $sid<BR>";
 print "now session id : $session{_session_id}<BR>";
 print "Previous data : " ; print_data();
 #push(@{ $session{aref} }, 'c');
 my @data_alphabetic = (A..Z,a..z,1..9);
 my @data_random;
 push @data_random , $data_alphabetic[ rand @data_alphabetic ] for (1..8);
 $session{aref} = join '', @data_random ;
 print "Next data : " ; print_data();
#sleep 10;
#tied(%session)->delete;

}else {
 $sid = $session{_session_id};
 $session{aref} = [ 'a' , 'b' ];
 my $cookie = $q->cookie( -name => $cookie_name , -value => $sid );
 print $q->header(-cookie => $cookie ); # , -type=>'text/html' );
 print "Save cookie name '$cookie_name' with value : $sid<BR>";
 print "Cookie Value to be stored : "; print_data();
 print "Cookie Value that is get from Apache::Session is : " , Dumper
$session{aref} ;
 print_br();
}
#clean();


sub print_data {
 print Dumper $session{aref} ;
 print_br();
}

sub print_br {
 print "<BR>";
}

sub clean {
 opendir(DIR,"$session_data_directory");
 map { print "$_<BR>" } grep { $_ !~ /^\.+/ and print -A
"$session_data_directory/$_" , print_br() } readdir(DIR);
 closedir(DIR);
}

=== end sample script that is error ======



Re: where to report apache::session 1.53 bug ?

Posted by "Jeffrey W. Baker" <jw...@acm.org>.

On Thu, 28 Jun 2001, Iwan Garnadi wrote:

> I don't know where to report apache::session bug , because I sent to the
> author , I didn't get any reply yet

Maybe you will have to wait more than four days...

-jwb