You cannot "store" the connection object for later use. You must use it
during the respective callbacks and you may store your own context in the
void** argument of the callback (if needed).
Most importantly, there is no way to put connection objects into a queue ---
the design is such that MHD tells you when you can (and, depending on your
threading model, have to) process connection data. Putting connections onto a
queue for processing, while theoretically possible with "external select" (but
very hard and I'm not going to show how, that'd be a LOT of work), is not
On Friday 11 December 2009 12:13:39 you wrote:
> Hi Christian,
> I am using your libmicrohttpd as the Final Year Project Embedded Http
> I am facing a problem right now and stuck.
> This is the scenario:
> I need to store the MHD_Connection object somewhere so that i can post
> back the http response back to the browser after i've finished processing
> the logic.
> I tried to memcpy like this:
> memcpy(&(q_ptr->connection), connection, sizeof(q_ptr->connection));
> and i store it in a structure and send to the message Queue.
> Another class will get it back from the Queue and use it.
> and it doesn't work when i pass the connection object to MHD_quee_response
> MHD_queue_response (&(param1->connection), MHD_HTTP_OK, response);
> Finally my program crashed.
> Any thought?