[PATCH] more data structures public in mongoose.h

Nick Withers nick.withers at anu.edu.au
Thu Nov 20 01:15:00 UTC 2014


On Wed, 2014-11-19 at 19:16 +0100, Ben Gras wrote:
> The attached patch is a proposed solution to a problem I am having
> with interfacing with the mongoose httpd for which I've found no
> canonical (or any other) clean solution.
> 
> The problem is that some of the data structures needed for some
> operations, specifically writing callbacks that get invoked for some
> HTTP requests, are declared in mongoose.c and therefore are not
> available to external programs, i.e. clients of mongoose. This is the
> mg_connection struct & its dependencies. It is passed as an argument
> to callbacks, and even without referencing the object the code won't
> compile if the struct isn't fully known.

Would struct mg_request_info *mg_get_request_info(struct mg_connection
*) help you? I use that to pull out the user_data field (passed to
mongoose_start()) in Mongoose callbacks.

You don't need to have the definition of struct mg_connection exposed
for this scenario, at least.
-- 
Nick Withers

Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)




More information about the devel mailing list