perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Krohn <>
Subject Re: unable to handle range requests with handler
Date Fri, 25 May 2012 15:27:06 GMT
Hi Joe,

> Largely depends on how httpd implements SSI I think- if they
> use sendfile then the bucket isn't there for good reason.
> Have you considered driving the output filter chain yourself,
> that way *you* can put an EOS bucket on the first brigade you
> build and pass to ap_pass_brigade.  That'd be the way I'd
> go rather than hoping httpd includes your patch (essentially
> implement ap_send_fd in perl).

I don't think Apache uses ap_send_fd at all (verified by a grep), and
mentioned here:

Also, I was certainly thrown off by docs that suggested with apache 2,
it "just worked", i.e.:

and a few mailing lists posts. Once I sort this out, will put a doc
patch back to make it clear. =)

Would it be worth implementing the ap_send_fd code in xs/Apache2/RequestIO/Apache2__RequestIO.h
with the eos bucket there? I think it would be really nice if range
requests "just worked" out of the box. =)

If patching mod_perl/apache doesn't make sense (and it may not, still
not 100% about implications of having the eos bucket in ap_send_fd /
requestio sendfile, or the reason for the check for it in range requests),
can you provide a pointer on how to do this with filters?

i.e. can I do something like:

sub handler {
    my $r = shift;
    return Apache2::Const::OK;

sub add_eos {
    my ($f, $bb) = @_;
    my $ba = $bb->bucket_alloc;
    my $b = APR::Bucket::eos_create($ba);
    my $rv = $f->next->pass_brigade($bb);
    return $rv unless $rv == APR::Const::SUCCESS;
    return Apache2::Const::OK;

Well, I can't as it doesn't work, but am I on the right track? =)



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message