"Beau E. Cox" <[EMAIL PROTECTED]> writes:

[...]

>   ($self->{cookie_class} is 'Apache::Cookie')
>   my $cookie =
>      $self->{cookie_class}->new( Apache->request, ... );
>   -- OK

This is correct usage, because Apache->request is an 
Apache::RequestRec object in mp2.

> 
>   my $cookie =
>      $self->{cookie_class}->new( $self->apache_req, ... );
>   -- Segmentation fault (11)
> 
>   my $apr = Apache::Request->new( $self->apache_req );
>   -- Segmentation fault (11)

These are (currently) incorrect calls, because the argument 
to new() MUST be an Apache::RequestRec object, not an
Apache::Request object.  The segfault is of course a bug
in Apache::Request, but in the meantime you can avoid it by 
using env() to pull the base Apache::RequestRec object out of 
your Apache::Request object:

  my $cookie = $self->{cookie_class}->new($self->apache_req->env,...);
  my $apr = $self->apache_req; # (no need to call new() here)

-- 
Joe Schaefer


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to