Re: Questions about apreq_params

"Philip M. Gollucci" <[email protected]> Mon, 15 Dec 2008 16:41:53 -0500
Newsgroups gmane.comp.apache.apreq
Organization P6 Web Applications Inc.
Message-ID <[email protected]>
Michael Koziarski wrote:
> Hey guys,
> 
> first, apologies for messing up the subscribe email!
> 
> We've just started using apreq for some apache module development and
> it's working out quite nicely.  However we've noticed a few strange
> issues.
> 
> The first of which is that apreq_params returns NULL if we use the
> following as the multipart body:
> 
> http://github.com/rails/rails/tree/master/actionpack/test/fixtures/multipart/large_text_file
> 
>   apr_table_t *request_body = apreq_params(req, r->pool);
>   if (request_body == NULL)
>   {
>     // we are seeing this
>   }
> 
> 
> The documentation implies that it never does, which makes me wonder.
> Is that just a stale piece of documentation or have we found a bug in
> libapreq?  Should we be handling this case in our module or figuring
> out a test case for you guys to fix in 2.10?
Clearly the function can return NULL, what documentation do you refer to ?

APREQ_DECLARE(apr_table_t *)apreq_params(apreq_handle_t *req, apr_pool_t *p)
{
     const apr_table_t *args, *body;
     apreq_args(req, &args);
     apreq_body(req, &body);

     if (args != NULL)
         if (body != NULL)
             return apr_table_overlay(p, args, body);
         else
             return apr_table_copy(p, args);
     else
         if (body != NULL)
             return apr_table_copy(p, body);
         else
             return NULL;

}



-- 
------------------------------------------------------------------------
Philip M. Gollucci ([email protected]) c: 703.336.9354
Consultant - P6M7G8 Inc.  http://p6m7g8.net
Senior System Admin - RideCharge, Inc.  http://ridecharge.com
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.