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