Michael Heidel wrote:
Hi List,


we got a strange problem on Apache/2.0.52 (Unix) mod_perl/1.99_18 Perl/v5.8.5.


$r->content_type('image/jpeg');
$r->sendfile($docname);

returns an empty image (length: 0).

it doesn't return anyhing but success code

The jpg image $docname exists and is readable for apache.

Also error handling does not work:

If we change $document to a _not_ existing file, then

$r->sendfile($docname) || return $err->handle( ... )
will NOT return $err->handle()

In this case also
my $rc=$r->sendfile($docname);
unless ($rc==APR::SUCCESS) {
  return $err->handle ( ... );
}

will not return $err->handle().


Any ideas?

Sorry Michael, I don't understand where did you copy that $err->handle code from, this is not how it works. Take a look at:
http://perl.apache.org/docs/2.0/api/Apache/RequestIO.html#C_sendfile_


and some examples in the test: t/response/TestAPI/sendfile.pm

May I ask where did you take this code from?

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

--
Report problems: 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