I was able to do following but have some issue in MHD_queue_response.
Scenario: Main thread having select, without any MHD threads with curl
multi integration.(updated benchmark.c)
1. Receive GET,  on 2nd call of ahc_echo, saved the connection pointer and
invoked curl client to GET to another server.
2. On rsp from second server & curl_multi_perform success, data is copied
and saved in association to connection in #1.
3. Just after #2, when curl_multi_info_read is successful ,
MHD_queue_response is invoked, but it returns 0 and the easy_handle state
is 1.

Can we send the response to client only from the MHD callback handler ? or
something is missing in above ?
Any help will be appreciated.

Thanks,
Kunal

On Mon, Aug 27, 2018 at 2:45 PM Kunal Ekawde <kunaleka...@gmail.com> wrote:

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


-- 
~Kunal

Reply via email to