Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

range request support using ap_send_fd

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


alex at gt

May 24, 2012, 6:29 PM

Post #1 of 1 (256 views)
Permalink
range request support using ap_send_fd

Hi,

I'm working on a problem where mod_perl doesn't seem to accept range
requests documented here:

http://www.gossamer-threads.com/lists/modperl/dev/104360

Working with 2.2.22, my issue seems to be the mod_perl sendfile
implementation uess ap_send_fd, and ap_send_fd does not create an EOS
bucket, so in byterange_filter.c:

/*
* Don't attempt to do byte range work if this brigade doesn't
* contain an EOS, or if any of the buckets has an unknown length;
* this avoids the cases where it is expensive to perform
* byteranging (i.e. may require arbitrary amounts of memory).
*/

if (!APR_BUCKET_IS_EOS(e) || clength <= 0) {
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}

we don't handle range requests, and so my mod_perl handler does not work
with range requests.

My question is should ap_send_fd be inserting an eos bucket? i.e.

alex [at] ale ~/httpd-2.2.22 $ diff -u server/protocol.c.orig server/protocol.c
--- server/protocol.c.orig 2012-01-24 12:02:19.000000000 -0800
+++ server/protocol.c 2012-05-24 18:24:57.914018451 -0700
@@ -1386,6 +1386,8 @@
bb = apr_brigade_create(r->pool, c->bucket_alloc);
b = apr_bucket_file_create(fd, offset, len, r->pool, c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
+ b = apr_bucket_eos_create(c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(bb, b);

rv = ap_pass_brigade(r->output_filters, bb);
if (rv != APR_SUCCESS) {
alex [at] ale ~/httpd-2.2.22 $

which does "fix" the problem for me (i.e. range requests work), but I
have no idea the implications behind this and the warning in the comment
about arbitrary amounts of memory. =)

Thanks for any help/guidance you can provide.

Cheers,

Alex

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.