Nathan Byrd wrote:
Hi all,

I'm currently attempting to upgrade Apache::PAR to work with mod_perl 2,
and one of the issues I am running into is with byterange requests:

With mod_perl 1.x, it was possible (using Apache::File) to use
byteranges with requests using $r->each_byterange and $r->set_byterange
(a good example is in the mod_perl Developer's Cookbook, section 6.7,
Byteserving and Range Requests.)

It appears that with Apache2/mod_perl2 ap_each_byterange and
ap_set_byterange are no longer available, replaced instead by a protocol
filter in Apache.  The only documentation for Apache I could find
regarding this is at
http://httpd.apache.org/docs-2.0/developer/filters.html - in that
document, it explains that "Byterange:  We have coded it to be inserted
for all requests, and it is removed if not used."

Does anyone know if the above statement includes mod_perl requests, or
is there another workaround to send byterange responses with mod_perl
modules?  I suppose it could be implemented in the module itself (or as
a patch to mod_perl, maybe in Apache::Response), but I don't want to
attempt that if the byterange filter could be run anyway for a request.
I've read the ap_byterange_filter() code (modules/http/http_protocol.c) and it has all the bytecode functionality in that function, plus a helper ap_set_byterange, which is private to that filter, so it can't be used by mod_perl.

If I understand correctly the benefits of slicing the response in the response handler is good if it somehow saves memory/CPU cycles. Otherwise byterange_filter will do that work for you.

It looks like implementing this functionality as a third party module is a good idea. Mostly likely you can simply rip off the code from ap_byterange_filter, making it more modular and then adding the XS to have the perl api. Or you can write the whole thing in perl. I think all the ingredients are readily available.

__________________________________________________________________
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

Reply via email to