On Fri, Nov 20, 2009 at 22:01, pranil dasika <[email protected]> wrote:
> Hi,
>
> I am trying to write a custom module where I need to read post parameters
> from the request. I guess apreq library is relevant to this but could not
> find any substantial examples or documents.
> Is there any other way to read the params other than apreq. Any pseudocode/
> examples will be appreciated.
>
> Thanks,
> Pranil
>
Here you have an example. It is not optimal, you could, for example,
take the brigade creation out of the loop and clean the brigade at the
end of each iteration, after you extracted the data.
apr_bucket_brigade *bb;
do {
bb = apr_brigade_create(req->pool, req->connection->bucket_alloc);
if (0 == bb)
// error
if (APR_SUCCESS != ap_get_brigade(req->input_filters, bb,
AP_MODE_READBYTES, APR_BLOCK_READ, 9216))
// error
extract data from bb;
} while (EOS not yet encountered in bb);
S