Re: [libmicrohttpd] Question on Async support

2018-08-27 Thread Santos Das
Hi,

Thanks for your reply. I have a question on how we do the asynchronous
operation (when I am running the michrohttpd as a part of my thread and in
the same event loop) ?

For example, my application received a http message and as a part of
handling the message it  has to send out another request (for example, I
trigger a message over diameter interface) and will send out the http
response only after receiving the response from my created procedures (for
example in this case the http response would be sent once the reply over
diameter interface is received.

Can the application send and receive the data through the callback  ?

Could you please let me know how this can be achieved ?

Thanks, Santos

On Fri, Aug 24, 2018 at 11:59 PM Christian Grothoff 
wrote:

> On 08/24/2018 08:05 PM, Santos Das wrote:
> > Thank you once again for the prompt reply.
> >
> > I have few more questions. Are you aware of any project which has
> > integrated libmicrohttpd along with libcurl without losing any
> > functionality of MHD ? I really want to run in the single threaded model
> > as I mentioned above.
>
> GNUnet and GNU Taler (in Twister) do this for implementing an http
> proxy, basically HTTP server via MHD, then libcurl for the HTTP client:
>
> https://git.taler.net/twister.git/
>
> I don't see why you think integrating with libcurl would result in a
> loss of functionality.
>
>


[libmicrohttpd] Aync handling & message response

2018-08-27 Thread Kunal Ekawde
Hi,

With ref to:
https://lists.gnu.org/archive/html/libmicrohttpd/2018-08/msg00015.html , I
gone through twister, but looks like this is sync operation. The curl
operation is performed sync in same thread. I wanted to know if there is a
way to make it async, so basically on receiving the data callback (entire
data), we should be able to store the connection details (cls ?) so that
server can do some other task, like may be fetch from DB. When server is
ready with response, it should be able to call MHD_queue_response with the
stored connection details. When it breaks to fetch from DB, it could also
handle other incoming requests.
Let me know If I'm missing something here or if there is any pointers w.r.t
use of MHD in this way preferably using raw epoll instead of GNUnet.

Threading model interested is : Application is single threaded with its own
epoll, MHD not to create any threads.

Thanks,
~Kunal