Skip Menu |

This queue is for tickets about the MasonX-Request-WithApacheSession CPAN distribution.

Report information
The Basics
Id: 7685
Status: resolved
Priority: 0/
Queue: MasonX-Request-WithApacheSession

People
Owner: brad [...] divisionbyzero.net
Requestors: mat [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.30
Fixed in: (no value)

Attachments
MasonX-Request-WithApacheSession-0.31.tar.gz



Subject: Problem when using with CGI
After about 2 hours of modifying things everywhere, this makes it work : --- /usr/local/lib/perl5/site_perl/5.8.5/MasonX/Request/WithApacheSession.pm~ Fri Sep 17 18:47:07 2004 +++ /usr/local/lib/perl5/site_perl/5.8.5/MasonX/Request/WithApacheSession.pm Fri Sep 17 18:47:25 2004 @@ -87,9 +87,9 @@ param_object => $self->apache_req, ); } - elsif ($self->can('cgi_object')) + elsif ($self->can('cgi_object') && $self->can('cgi_request')) { - %extra = ( header_object => $self->cgi_object, + %extra = ( header_object => $self->cgi_request, param_object => $self->cgi_object, ); }
Date: Mon, 20 Sep 2004 22:21:11 -0500 (CDT)
From: Dave Rolsky <autarch [...] urth.org>
To: via RT <bug-MasonX-Request-WithApacheSession [...] rt.cpan.org>
Subject: Re: [cpan #7685] Problem when using with CGI
RT-Send-Cc:
On Fri, 17 Sep 2004, via RT wrote: Show quoted text
> After about 2 hours of modifying things everywhere, this makes it work :
Can you write a test, or at least explain to me what the symptoms of the problem were? I'd like to have some way to confirm the bug, and at this point I don't even know what the bug is. -dave /*=========================== VegGuide.Org Your guide to all that's veg. ===========================*/
Subject: problem explaination
From: jo2y [...] midnightlinux.com
[autarch@urth.org - Tue Sep 21 00:01:25 2004]: Show quoted text
> Can you write a test, or at least explain to me what the symptoms of > the > problem were? I'd like to have some way to confirm the bug, and at > this > point I don't even know what the bug is.
I'm not the original poster, but I'm fairly sure I was having the same problem as he was and his patch fixes it. The symptom I saw was this error in the apache logs: [Tue Nov 30 02:23:23 2004] [error] [client 151.201.221.152] FastCGI: server "/var/www/sbin/mason_handler.fcgi" stderr: The 'header_object' parameter ("CGI::Fast=HASH(0x85df32c)") to Apache::Session::Wrapper->new() did not pass the 'header method' callback It seems that CGI and CGI::Fast don't impliment the headers_out method, but whatever object $self->cgi_request returns does. If you need more details, let me know. -james (jo2y@midnightlinux.com)
The problem is that -- when cookies are not desired and running as FastCGI -- the code (a subclass of HTML::Mason::Request::CGI by this point) tests whether it responds to the cgi_object method, and then sets up header_object and param_object to point to the cgi_object result. These objects do not respond to the methods required by the rest of code. Specifically the code has two errors. First the cgi_object method is implemented by both Apache and CGI type Mason objects. Thus, the test should be for cgi_process which is only implemented by the CGI type. Second, the cgi_object does not respond to any of the cookie-setting mechanisms. It is the cgi_request object that does so, so the header_object should be set to cgi_request, not cgi_object. The correct elsif case follows: elsif ( $self->can('cgi_request') ) { %extra = ( header_object => $self->cgi_request, param_object => $self->cgi_object, ); } Colin Henein
On Wed Jun 29 11:16:16 2005, guest wrote: Show quoted text
> The problem is that -- when cookies are not desired and running as > FastCGI -- the code (a subclass of HTML::Mason::Request::CGI by this > point) tests whether it responds to the cgi_object method, and then > sets up header_object and param_object to point to the cgi_object > result. These objects do not respond to the methods required by the > rest of code. > > Specifically the code has two errors. > > First the cgi_object method is implemented by both Apache and CGI type > Mason objects. Thus, the test should be for cgi_process which is only > implemented by the CGI type. > > Second, the cgi_object does not respond to any of the cookie-setting > mechanisms. It is the cgi_request object that does so, so the > header_object should be set to cgi_request, not cgi_object. > > The correct elsif case follows: > > elsif ( $self->can('cgi_request') ) > { > %extra = ( header_object => $self->cgi_request, > param_object => $self->cgi_object, > ); > } > > Colin Henein
According to your "First" statement, I was expecting the correct elsif to be: elsif ( $self->can('cgi_process') )) { %extra = ( header_object => $self->cgi_request, param_object => $self->cgi_object, ); } There are no tests in the test suite to test under a CGI environment and I've never used Mason in a CGI Environment. If I send you an updated version of the above, would you be able to test it?
This bug is affecting me, as well. We are applying the patch locally, which is a pain. -- rjbs
I've had the patches incorporated for a while, but I got horribly busy. Here's the 0.31 release that's been sitting on my svn server for far too long. Can someone here test it, I don't run in CGI and don't have the time right now. If it works, I'll upload it to the CPAN immediately. Thanks, -brad..

Message body not shown because it is not plain text.