You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by st...@apache.org on 2004/04/06 00:44:30 UTC

cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

stas        2004/04/05 15:44:30

  Modified:    build    xsbuilder.pl
               glue/perl/xsbuilder/Apache/Cookie Cookie_pm
               glue/perl/xsbuilder/Apache/Request Request_pm
  Log:
  - deal with undef's being used to compare or being dereferenced
  - tighten up the warnings allowance, make them fatal early on so we deal
  with them
  
  Revision  Changes    Path
  1.22      +18 -11    httpd-apreq-2/build/xsbuilder.pl
  
  Index: xsbuilder.pl
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/build/xsbuilder.pl,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -u -r1.21 -r1.22
  --- xsbuilder.pl	24 Mar 2004 08:22:47 -0000	1.21
  +++ xsbuilder.pl	5 Apr 2004 22:44:30 -0000	1.22
  @@ -233,36 +233,42 @@
   sub pm_text {
       my($self, $module, $isa, $code) = @_;
   
  -    return <<EOF;
  +    my $text = <<"EOF";
   $self->{noedit_warning_hash}
   
   package $module;
   require DynaLoader ;
  -use strict ;
  +
  +use strict;
  +use warnings FATAL => 'all';
  +
   use vars qw{\$VERSION \@ISA} ;
   $isa
   push \@ISA, 'DynaLoader' ;
   \$VERSION = '$version';
   bootstrap $module \$VERSION ;
  +EOF
   
  -# XXX How do we test for the appropriate modperl version?
  -# The modperl package isn't necessarily loaded, but Apache2
  -# is.  Perhaps Apache2 should always include a VERSION?
  +    $text .= <<'EOF';
   
  -if (\$ENV{MOD_PERL}) {
  +if ($ENV{MOD_PERL}) {
       require mod_perl;
  -    if (\$mod_perl::VERSION > 1.99) {
  +    my $env = __PACKAGE__->env || '';
  +    if ($mod_perl::VERSION > 1.99) {
           die __PACKAGE__ . ": httpd must load mod_apreq.so first"
  -               if __PACKAGE__->env ne "Apache::RequestRec";
  +               if $env ne "Apache::RequestRec";
       }
  -    elsif (\$mod_perl::VERSION > 1.24) {
  +    elsif ($mod_perl::VERSION > 1.24) {
           die __PACKAGE__ . ": httpd must load mod_apreq1.so first"
  -              if __PACKAGE__->env ne "Apache";
  +              if $env ne "Apache";
       }
       else {
  -       die "Unrecognized mod_perl version number: \$modperl::VERSION";
  +       die "Unrecognized mod_perl version number: $modperl::VERSION";
       }
   }
  +EOF
  +
  +    $text .= <<"EOF";
   
   $code
   
  @@ -270,6 +276,7 @@
   __END__
   EOF
   
  +        return $text;
   }
   sub makefilepl_text {
       my($self, $class, $deps,$typemap) = @_;
  
  
  
  1.13      +1 -3      httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Cookie_pm
  
  Index: Cookie_pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Cookie/Cookie_pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -u -r1.12 -r1.13
  --- Cookie_pm	9 Feb 2004 21:58:37 -0000	1.12
  +++ Cookie_pm	5 Apr 2004 22:44:30 -0000	1.13
  @@ -1,5 +1,3 @@
  -use strict;
  -use warnings FATAL => 'all';
   
   use APR;
   use APR::Table;
  @@ -33,7 +31,7 @@
   sub fetch {
       my $self = shift;
       my $jar = $self->jar(@_);
  -    return wantarray ? %{scalar $jar->cookie} : $jar->cookie;
  +    return wantarray ? %{(scalar $jar->cookie) || {}} : $jar->cookie;
   }
   
   sub freeze {
  
  
  
  1.9       +0 -2      httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Request_pm
  
  Index: Request_pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Request_pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- Request_pm	9 Feb 2004 21:58:37 -0000	1.8
  +++ Request_pm	5 Apr 2004 22:44:30 -0000	1.9
  @@ -1,5 +1,3 @@
  -use strict;
  -use warnings FATAL => 'all';
   
   use APR;
   use APR::Table;
  
  
  

Re: cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Joe Schaefer wrote:
> 
>> Stas Bekman <st...@stason.org> writes:
>>
>> [...]
>>
>>
>>> But I think we should nuke that 1.x part while we don't support 1.x,
>>> since it'll only confuse users if they get to load Apache::Request
>>> built for mp1 from their mp2 server.
>>
>>
>>
>> +1.
> 
> 
> Please commit it, as I can't use cvs at the moment. Thanks!

Never mind, I've managed to get it to work :)

-- 
__________________________________________________________________
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: cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> 
>>But I think we should nuke that 1.x part while we don't support 1.x,
>>since it'll only confuse users if they get to load Apache::Request
>>built for mp1 from their mp2 server.
> 
> 
> +1.

Please commit it, as I can't use cvs at the moment. Thanks!

Index: build/xsbuilder.pl
===================================================================
RCS file: /home/cvs/httpd-apreq-2/build/xsbuilder.pl,v
retrieving revision 1.22
diff -u -r1.22 xsbuilder.pl
--- build/xsbuilder.pl  5 Apr 2004 22:44:30 -0000       1.22
+++ build/xsbuilder.pl  7 Apr 2004 02:02:24 -0000
@@ -256,14 +256,10 @@
      my $env = __PACKAGE__->env || '';
      if ($mod_perl::VERSION > 1.99) {
          die __PACKAGE__ . ": httpd must load mod_apreq.so first"
-               if $env ne "Apache::RequestRec";
-    }
-    elsif ($mod_perl::VERSION > 1.24) {
-        die __PACKAGE__ . ": httpd must load mod_apreq1.so first"
-              if $env ne "Apache";
+            if $env ne "Apache::RequestRec";
      }
      else {
-       die "Unrecognized mod_perl version number: $modperl::VERSION";
+        die "Unsupported mod_perl version number: $modperl::VERSION";
      }
  }
  EOF

-- 
__________________________________________________________________
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: cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

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

[...]

> But I think we should nuke that 1.x part while we don't support 1.x,
> since it'll only confuse users if they get to load Apache::Request
> built for mp1 from their mp2 server.

+1.

-- 
Joe Schaefer


Re: cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> 
>>>  -if (\$ENV{MOD_PERL}) {
>>>  +if ($ENV{MOD_PERL}) {
>>>       require mod_perl;
>>>  -    if (\$mod_perl::VERSION > 1.99) {
>>>  +    my $env = __PACKAGE__->env || '';
>>>  +    if ($mod_perl::VERSION > 1.99) {
>>>           die __PACKAGE__ . ": httpd must load mod_apreq.so first"
>>>  -               if __PACKAGE__->env ne "Apache::RequestRec";
>>>  +               if $env ne "Apache::RequestRec";
>>>       }
>>>  -    elsif (\$mod_perl::VERSION > 1.24) {
>>>  +    elsif ($mod_perl::VERSION > 1.24) {
>>>           die __PACKAGE__ . ": httpd must load mod_apreq1.so first"
>>>  -              if __PACKAGE__->env ne "Apache";
>>>  +              if $env ne "Apache";
>>
>>Why are we dealing with apreq1 in apreq2, again?
> 
> 
> I'm not sure what you're asking about here, but the code 
> in question was part of the plan to backport apreq2's Perl API
> to apache-1.3.  If you want to take it out, I won't object
> since I'm not going to devote any more time to that effort.

I remember that. The reason I've asked is that we use things like:

   use warnings FATAL => 'all';

which is not available for perl < 5.6. So as long as we stick with mp2, we 
know that we run 5.6.1+ and that syntax is fine. If not, then we either can't 
use it or need to install some backcompat wrapper like Apache-Test does.

But I think we should nuke that 1.x part while we don't support 1.x, since 
it'll only confuse users if they get to load Apache::Request built for mp1 
from their mp2 server.

__________________________________________________________________
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: cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

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

> >   -if (\$ENV{MOD_PERL}) {
> >   +if ($ENV{MOD_PERL}) {
> >        require mod_perl;
> >   -    if (\$mod_perl::VERSION > 1.99) {
> >   +    my $env = __PACKAGE__->env || '';
> >   +    if ($mod_perl::VERSION > 1.99) {
> >            die __PACKAGE__ . ": httpd must load mod_apreq.so first"
> >   -               if __PACKAGE__->env ne "Apache::RequestRec";
> >   +               if $env ne "Apache::RequestRec";
> >        }
> >   -    elsif (\$mod_perl::VERSION > 1.24) {
> >   +    elsif ($mod_perl::VERSION > 1.24) {
> >            die __PACKAGE__ . ": httpd must load mod_apreq1.so first"
> >   -              if __PACKAGE__->env ne "Apache";
> >   +              if $env ne "Apache";
> 
> Why are we dealing with apreq1 in apreq2, again?

I'm not sure what you're asking about here, but the code 
in question was part of the plan to backport apreq2's Perl API
to apache-1.3.  If you want to take it out, I won't object
since I'm not going to devote any more time to that effort.

-- 
Joe Schaefer


Re: cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Request_pm

Posted by Stas Bekman <st...@stason.org>.
>   -if (\$ENV{MOD_PERL}) {
>   +if ($ENV{MOD_PERL}) {
>        require mod_perl;
>   -    if (\$mod_perl::VERSION > 1.99) {
>   +    my $env = __PACKAGE__->env || '';
>   +    if ($mod_perl::VERSION > 1.99) {
>            die __PACKAGE__ . ": httpd must load mod_apreq.so first"
>   -               if __PACKAGE__->env ne "Apache::RequestRec";
>   +               if $env ne "Apache::RequestRec";
>        }
>   -    elsif (\$mod_perl::VERSION > 1.24) {
>   +    elsif ($mod_perl::VERSION > 1.24) {
>            die __PACKAGE__ . ": httpd must load mod_apreq1.so first"
>   -              if __PACKAGE__->env ne "Apache";
>   +              if $env ne "Apache";

Why are we dealing with apreq1 in apreq2, again?


__________________________________________________________________
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