Hi,

If /image/1000/foo.gif does not map to an actual file
on the server, you will need to have content length
set for set_byterange to work. Otherwise, check out
the C source for ap_set_byterange in http_protocol.c
(in Apache distribution).

dak
----

--- Kevin Murphy <[EMAIL PROTECTED]> wrote:
> I'm attempting to use the byteserving methods of
> Apache::File, but I'm
> getting strange results. Apache 1.3.9, mod_perl
> 1.21. 
> 
> Here's the request (entered via telnet to port 80):
> 
> GET /image/1000/foo.gif HTTP/1.1
> Host: www.eorbit.net
> Range: bytes=0-50
> 
> Here's a code snippet:
> .
> .
> .
>   unless ($r->header_only)
>   {
>     my $rangestatus = $r->set_byterange;
> 
>     $log->debug("Byte ranges?: $rangestatus");
> 
>     if (!$rangestatus)
>     {
>       $log->debug("Whole file request");
>       $r->send_fd($fh);
>     }
>     else
>     {
>       $log->debug("Byte range request");
>       my $head_length= length($v2Tag);
>       while(my($offset, $range_length) =
> $r->each_byterange)
>       {                      
>          {do byteserving foo}
>        }          
>      }
>    }
> .
> .
> .
> 
> The problem? Doing a dump of $r->headers_in shows
> that the Range:
> header is is present, but when I call
> $r->set_byterange, it returns
> zero, regardless of whether the Range: header is
> there or not.
> 
> Am I constructing my request badly, or is there
> something else I'm 
> missing? I put this code together from some sample
> code that Doug 
> posted to the list some time ago, and there doesn't
> seem to be any
> further documentation on this portion of the request
> object.
> 
> -- 
> Kevin |"'I was drunk' is a polite way of saying 'I
> shed my inhibitions 
>       | and did exactly what I wanted to do, and if
> you provoke me,     
>       | I'll | do it again.' This gives people fair
> warning and tells 
>       | them tactfully to mind their own business."
> - P.J. O'Rourke
> 

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Reply via email to