httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Endecott <>
Subject Re: Accessing POST request body from a module
Date Fri, 03 Feb 2006 20:26:47 GMT
 >> I am porting some CGI code to run as a module.  It is all pretty
 >> straightforward, except that I can't work out how to get at a POST
 >> request's body.

Thanks to Michael for this:

 > while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES,
 >     apr_brigade_flatten(brigade, buf, &len);
 >     apr_brigade_cleanup(brigade);
 >     tlen += len;
 >     if (tlen == count_bytes || !len) {
 >         break;
 >     }
 >     buf += len;
 >     len = count_bytes - tlen;
 > }

That looks good and I've tried something like it, but it seems to 
segfault as soon as ap_get_brigade is called.  I'm guessing that I need 
to create the brigade first, but apr_brigade_create has a second 
mysterious parameter that I can't work out.  Michael, maybe you just 
need to post the five lines before those??

BTW, is there any better documentation for this than

Nick Kew wrote:

 > If you had a usable-looking email address. I could reply with
 > exactly what you need

I'm sorry that it doesn't look useable to you, but I can assure you that 
it does work; it's not even filtered.  It would be quite hard to 
subscribe to this list with a non-functioning address, I think.



View raw message