Re: mod_perl 1.99: sendfile returns empty document

[prev] [thread] [next] [Date index for 2004/12/30]

From: Stas Bekman
Subject: Re: mod_perl 1.99: sendfile returns empty document
Date: 15:30 on 30 Dec 2004
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:stas@xxxxxx.xxx 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

mod_perl 1.99: sendfile returns empty document
Michael Heidel 10:20 on 30 Dec 2004

Re: mod_perl 1.99: sendfile returns empty document
Stas Bekman 15:30 on 30 Dec 2004

Generated at 12:16 on 16 Jan 2005 by mariachi v0.52