Scott Penrose wrote:
Hey Guys

I wrote a simple Filter which calls a subrequest - and started by doing this very simply along the SSI style lines...

Please note - that although I could do this on the fly rather than buffer, the end result for my code requires capture of the content, so just imagine that bit is correct :-)

sub filter {
    ...
    ... buffer content into $context->{buffer} ...

        if ($f->seen_eos) {

                my $buffer = $context->{buffer};

                while ((my $i = index($buffer, "EXPAND")) >= 0) {
                        $f->print(substr($buffer, 0, $i));
                        $buffer = substr($buffer, $i + 6);

                        my $subr = $f->r->lookup_uri("/sub.html");
                        $subr->run();
                }
                $f->print($buffer);
        }
    ...
}


The above code always segfaults. Now the first thing that came to mind was that a $subr->run() would output by printing to stderr which of course would not work in the filter. Therefore I changed the code, using the Apache2::TrapSubRequest module to...

Is this a request or a connection filter? It won't work as a connection filter (r is not available there).

What's the core's backtrace?

--
_____________________________________________________________
Stas Bekman    mailto:[EMAIL PROTECTED] http://stason.org/
MailChannels: Reliable Email Delivery http://mailchannels.com
The "Practical mod_perl" book         http://modperlbook.org/
http://www.linkedin.com/in/stasbekman http://perl.apache.org/
http://stason.org/photos/gallery/     [* best photos here *]

Reply via email to