[Top][All Lists]

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

Re: [libmicrohttpd] MHD_create_response_from_callback() not called on PO

From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD_create_response_from_callback() not called on POST
Date: Tue, 27 Sep 2016 15:44:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0

Hi Leonard,

I suspect you're queuing the response at a time where MHD disallows it,
and then don't check the return value so you don't see the error message.

Anyway, if you want to study POST processing of JSON with MHD, we have a
big implementation doing just that in the Taler codebase at;a=tree;f=src/exchange;h=e59eb52b1b3e0c8b1a4394c0e372a1adb3d4aace;hb=HEAD

Happy hacking!


On 09/27/2016 11:44 AM, Leonard Bocock wrote:
> Hi
> Building a basic lightweight server that handles Server Side Events (using 
> HTTP GET is working) and JSON request/response using POST’d data request and 
> formatting a JSON response.  
> Provided the following is used (unsure why), JSON data appears in the 
> response callback function parameters, along with data length. The request is 
> small in length.
> MHD_create_response_from_callback()    if (&aptr != *ptr) {
>         *ptr = &aptr;
>         return MHD_YES;
>     }
> However, I want to bypass MHD_create_post_processor () and simply respond 
> back to the client using MHD_create_response_from_callback(). Except the 
> callback handler is never called. It’s the same approach I’m using for the 
> SSE GET, and that works fine.
> Is this by design I assume? Is there away, when handling a POST response, to 
> invoke the response handler callback? Or  is the only answer to mock up my 
> own MHD_create_post_processor construct to process JSON data?
> Thanks, Leonard.

Attachment: 0xE29FC3CC.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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