Dear Viktor,
Your code snippet looks fine. So I just tried and failed to reproduce
your problem. I basically simply used Wireshark and the existing code
from here:
https://git.gnunet.org/libmicrohttpd.git/tree/src/examples/http_chunked_compression.c
(Note: I fixed a relevant typo in the example
I use the following sequence of commands:
MHD_Response* resp = MHD_create_response_from_callback (
MHD_SIZE_UNKNOWN, DEFAULT_BLOCK_SIZE,
asyncReplyCallback, c, asyncReplyCleaner );
MHD_add_response_header (c->mConnection, "Content-Type", "application/json" );
MHD_queue_resp