> So, even if I am writing my own content out using sendfile, Apache will
> start it at the correct spot when it gets a Range request? 

yes.

> How does it
> do that...run my output up until the correct byte then start sending it
> out to the client?  

no.  your output is entered into the output filter stream.  you generate it
all every time, but apache intercepts the stream and manipulates it before
it gets to the client.  remember, byteserving is a bandwidth saver, not a
server-processing saver :)  and if you ever doubted that, trace how many
requests msie makes for the same resource _before_ you actually see it (it
used to be 3, and don't forget the processing doesn't stop just because the
client went away)

mod_deflate works the same way, as does mod_include - they all take the
content from the content handler (a cgi script, your handler, etc) and
post-process it on it's way back down the wire.

> I assumed I had to handle it myself.
> 
>>
>>> $r->headers_out->set('Content-Length' => $size);
>>
>>
>>
>> don't do that - use $r->set_content_length()
> 
> 
> Cool.  I actually thought the $len variable of sendfile would handle
> this for me, but it didn't appear to do anything.

actually, you don't need to calculate the length of the response anymore
either.  apache 2.0 has a content-length filter that uses the same mechanism
as above (calculating the length of the filter stream after everyone has
manipulated the content).

HTH

--Geoff


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