Cool - OK!

Please see below (one more question...  :)

On Thursday 29 January 2004 06:29 am, Joe Schaefer wrote:
> "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

Thank you very much, Joe - works fine.

One followup question, is this call OK in mod_perl2?

   $r->headers_in->unset('Content-length');

I have been changing all '$r->xxx_header_xxx' method
calls in my porting, but this one stumps me.

Aloha = Beau;





-- 
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