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

2001-06-28 Thread Iwan Garnadi

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 : $sidBR;
 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 : $sidBR;
 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 ?

2001-06-28 Thread Vivek Khera

 GB == Gunther Birznieks [EMAIL PROTECTED] 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: [EMAIL PROTECTED]   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 ?

2001-06-28 Thread Tatsuhiko Miyagawa

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 [EMAIL PROTECTED] 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:[EMAIL PROTECTED] http://www.edge.co.jp/




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

2001-06-27 Thread Knox, Laurie A, NPONS

Could you Please share your bug info with us?  I am using Apache::Session
now 
and having troubles with it...

Thank you!

Laurie

-Original Message-
From: Iwan Garnadi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 5:50 PM
To: [EMAIL PROTECTED]
Subject: 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 ?

2001-06-27 Thread Jeffrey W. Baker



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




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

2001-06-27 Thread Gunther Birznieks

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 ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/