libextractor
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libextractor] Re: How to store the MHD_Connection object for later use?


From: Christian Grothoff
Subject: [libextractor] Re: How to store the MHD_Connection object for later use?
Date: Fri, 11 Dec 2009 12:39:56 +0100
User-agent: KMail/1.12.2 (Linux/2.6.31-1-amd64; KDE/4.3.2; x86_64; ; )

Hi!

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 
recommended.

Best,

Christian

On Friday 11 December 2009 12:13:39 you wrote:
> Hi Christian,
> 
> I am using your libmicrohttpd as the Final Year Project Embedded Http
> Server.
> 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?
> Thanks.
> 

-- 
http://grothoff.org/christian/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]