Hi,
When responding to a POST request with application/octet-stream content I am
finding
that MHD_queue_response fails. Usage example below.
Digging inside libmicrphttpd, the queue_response fails because the
connection->state is
MHD_CONNECTION_CONTINUE_SENT. The connection in this instance does not use HTTP
100 continues.
The enclosed patch fixes the behaviour.
---
AccessHandlerCallback(...)
if (!strcmp(method,"POST")&& !partial_strcmp_left(url,"/process")) {
/* On the first callback interation, *upload_data_size is zero.
Upon second iteration, it is non-zero and contains 48-byte message
*/
if (!*upload_data_size)
return MHD_YES;
/* process upload_data.. */
rsp = MHD_create_response_from_data(sizeof(response), response,
MHD_NO, MHD_NO);
ret = MHD_queue_response(connection, MHD_HTTP_OK, rsp);
}
---
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)