Dear monks,

in a given situation we get xml data POSTed to our server, much alike RPC calls (actually they're a number of http (webdav) requests).

A (mod_perl) Fixuphandler traps these requests, parses the xml, and (should) from there on issue all requests to our server.

It seemed quite logical to (dynamically) create a subrequest for each given request. We would dynamically add a input filter to each subrequest, create a bucket brigade there, and fill the bb with the desired data; set the correct request headers, and run the sub-request.

(Part of) the code in the input filter that should do the trick is:

$bb = APR::Brigade->new($c->pool, $c->bucket_alloc); my $ba = $bb->bucket_alloc(); my $nb = APR::Bucket->new($ba, $data); $bb->insert_tail($nb); my $b = APR::Bucket::eos_create($ba); $bb->insert_tail($b); $r->headers_in->{'Content-Length'} = length ($data); $f->fflush($bb);

For some reason, the sub-request never picks up the bucket brigade. Is there something I've overseen, or am I just trying to do the plain impossible ?

rgrds,

walinsky


In reply to mod_perl - using input filters and bucket brigades to pass data to subrequests by walinsky

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.