You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Max Baker <ma...@warped.org> on 2005/02/08 23:03:39 UTC

[mp2] scalar $r->args() misbehaves with apache::compat.

-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:

[mp2] While using Apache::compat C<scalar $r->args()> returns "Apache::Request::Table=HASH(0x98d0ef8)".
It should return the full query string.

2. Used Components and their Configuration:

Using FreeBSD ports for apache2 and mod_perl2.

Under Mason 1.29.

*** mod_perl version 1.999020

*** using /usr/ports/www/mod_perl2/work/mod_perl-2.0.0-RC3/lib/Apache/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB      => aprext
  MP_APXS         => /usr/local/sbin/apxs
  MP_COMPAT_1X    => 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME      => mod_perl
  MP_USE_DSO      => 1


*** The httpd binary was not found


*** (apr|apu)-config linking info

 -L/usr/local/lib/apache2 -lapr-0 -lm -lcrypt 
 -L/usr/local/lib/apache2 -laprutil-0 -lexpat -liconv



*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=freebsd, osvers=5.3-release, archname=i386-freebsd-64int
    uname='freebsd freebsd.org 5.3-release freebsd 5.3-release #0: fri oct 15 12:04:25 pdt 2004 kris@freebsd.org:usrsrcsysmagickernelpath i386 '
    config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.5/mach -Dprivlib=/usr/local/lib/perl5/5.8.5 -Dman3dir=/usr/local/lib/perl5/5.8.5/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.5/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.5 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.8.5/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Doptimize=-O -pipe  -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN" -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
    optimize='-O -pipe ',
    cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.4.2 [FreeBSD] 20040728', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil -lc
    perllibs=-lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-R/usr/local/lib/perl5/5.8.5/mach/CORE'
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
  Built under freebsd
  Compiled at Oct 15 2004 19:10:40
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /usr/local/lib/perl5/site_perl/5.8.5/mach
    /usr/local/lib/perl5/site_perl/5.8.5
    /usr/local/lib/perl5/site_perl
    /usr/local/lib/perl5/5.8.5/BSDPAN
    /usr/local/lib/perl5/5.8.5/mach
    /usr/local/lib/perl5/5.8.5
    .

*** Packages of interest status:

Apache::Request: -
CGI            : 3.05
LWP            : -
mod_perl       : 1.999020


This report was generated by t/REPORT on Tue Feb  8 21:51:22 2005 GMT.

-------------8<---------- End Bug Report --------------8<----------

Re: [mp2] scalar $r->args() misbehaves with apache::compat.

Posted by Max Baker <ma...@warped.org>.
On Tue, Feb 08, 2005 at 09:16:54PM -0500, Stas Bekman wrote:
> Max Baker wrote:
> >-------------8<---------- Start Bug Report ------------8<----------
> >1. Problem Description:
> >
> >[mp2] While using Apache::compat C<scalar $r->args()> returns 
> >"Apache::Request::Table=HASH(0x98d0ef8)".
> >It should return the full query string.
> 
> Did you forget to attach the patch, Max?
> 
> It should be as simple as returning $r->args if wantarray is false. it's a 
> pure perl code after all.
> 
> and a new sub-test to test this case would be nice too.
> 
> Thanks Max.

Stas,

I haven't started looking at the internals of mod_perl2 yet, so I didn't
venture a patch.  I'm just trying to port over an existing Mason application
to mod_perl2.

Let me know if there's another way I could test it for you.

Thanks,
-m

Re: [mp2] scalar $r->args() misbehaves with apache::compat.

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> 
>>Max Baker wrote:
>>
>>>-------------8<---------- Start Bug Report ------------8<----------
>>>1. Problem Description:
>>>[mp2] While using Apache::compat C<scalar $r->args()> returns
>>>"Apache::Request::Table=HASH(0x98d0ef8)".
>>>It should return the full query string.
>>
>>Did you forget to attach the patch, Max?
>>
>>It should be as simple as returning $r->args if wantarray is
>>false. it's a pure perl code after all.
> 
> 
> Err, that looks like an apreq2 flub to me.  I suspect
> Apache::compat is irrelevant; $r is probably an Apache::Request 
> object above, so $r->SUPER::args might do what he wants.

Joe is right, this has nothing to do with modperl, since Apache::compat 
already does what I've suggested:

sub Apache::args {
     my $r = shift;
     my $args = $r->args;
     return $args unless wantarray;
     return $r->parse_args($args);
}

most likely your $r is not the original $r, but one re-blessed into 
Apache::Request (the original is Apache::RequestRec).


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] scalar $r->args() misbehaves with apache::compat.

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

> Max Baker wrote:
>> -------------8<---------- Start Bug Report ------------8<----------
>> 1. Problem Description:
>> [mp2] While using Apache::compat C<scalar $r->args()> returns
>> "Apache::Request::Table=HASH(0x98d0ef8)".
>> It should return the full query string.
>
> Did you forget to attach the patch, Max?
>
> It should be as simple as returning $r->args if wantarray is
> false. it's a pure perl code after all.

Err, that looks like an apreq2 flub to me.  I suspect
Apache::compat is irrelevant; $r is probably an Apache::Request 
object above, so $r->SUPER::args might do what he wants.

-- 
Joe Schaefer


Re: [mp2] scalar $r->args() misbehaves with apache::compat.

Posted by Stas Bekman <st...@stason.org>.
Max Baker wrote:
> -------------8<---------- Start Bug Report ------------8<----------
> 1. Problem Description:
> 
> [mp2] While using Apache::compat C<scalar $r->args()> returns "Apache::Request::Table=HASH(0x98d0ef8)".
> It should return the full query string.

Did you forget to attach the patch, Max?

It should be as simple as returning $r->args if wantarray is false. it's a 
pure perl code after all.

and a new sub-test to test this case would be nice too.

Thanks Max.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com