chunked_example: enforce to use chunked encoding

Previously MHD switches to identity encoding if connection
is not Keep-Alive
This commit is contained in:
Evgeny Grin (Karlson2k)
2021-05-06 11:26:34 +03:00
parent 3569c42c4c
commit 81bbdc7048
+8
View File
@@ -137,6 +137,14 @@ ahc_echo (void *cls,
free (callback_param);
return MHD_NO;
}
/* Enforce chunked response, even for non-keep-alive connection. */
if (MHD_NO == MHD_add_response_header (response,
MHD_HTTP_HEADER_TRANSFER_ENCODING,
"chunked"))
{
free (callback_param);
return MHD_NO;
}
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
return ret;