Andy Grundman wrote:
Geoffrey Young wrote:

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.


Awesome! Thank you so much...this is great. I am testing it by streaming an mp3 file and I am able to seek using Winamp to any point in the file and it handles it flawlessly! I do see it at work, my code gets past sendfile() almost immediately and then Apache takes over sending the data from there. And it uses no memory while doing so...very nice.

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


If I take out the length calcuclation, no Content-Length header gets generated. This makes sense though; what if you had 500MB of data... it would take many seconds to buffer that from disk while the client waited. Better to simply stat the file and send the proper length header.

Now, if you could summarize this as a pod section (with a simple example) to be added to 2.0 user docs, that will benefit all users who will have to deal with the same questions and they won't have to ask the same question here.


The best fit is probably after:
http://perl.apache.org/docs/2.0/user/handlers/http.html#Handling_HEAD_Requests
and title it: Handling Byte Range Requests

Thank you.
__________________________________________________________________
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