I have a PerlTransHandler that is very simple:
sub handler {
my($r) = @_;
my($info);
$info = $r->lookup_file('/home/pp/pierre.jpg')->content_type();
warn("content type is $info\n");
return DECLINED;
}
But it causes a segfault when invoked... I removed the
"->content_type()", so that I should normally see something like
"Apache::SubRequest=SCALAR(0x815eb54)", but it also crashes.
I tried using the exact same handler as a PerlHandler and as a
PerlHeaderParserHandler instead, and it works perfectly. I was thinking
that calling lookup_uri from within a PerlTransHandler might be a bad
idea (infinite loops!), but I would have thought that lookup_file would
be ok...
Okay, maybe everyone will jump in my face about this: this is on an
updated Red Hat 7.0 system, using Red Hat's Apache and mod_perl RPM
packages.
--
Pierre Phaneuf
http://www3.sympatico.ca/pphaneuf/