Yes, you MUST NOT queue a response while *upload_data_size is non-null
when you are being called (as the upload may still continue)! MHD will
call you one "final" time with a zero *upload_data_size, and *then* you
should queue your response.
To summarize, you MAY queue a response either:
1) on the very first call when *upload_data_size is 0 to return an error
and NOT have the client to the upload (e.g. 4xx/5xx), or
2) on the very last call when *upload_data_size is again 0 to return a
successful reply.
If you attempt to queue a response when you were called with a non-zero
*upload_data_size, MHD will not be happy. And yes, you should update
*upload_data_size to reflect the number of bytes left to process, but
setting it to 0 does not permit you to immediately queue a response.
I hope this helps!
Happy hacking!
Christian
On 5/22/23 22:01, Avner Flesch wrote:
Hi,
Maybe someone can help me:
When I am getting a "POST" request without content - everything is okay,
but when I am putting some content in the request, the
MHD_queue_response return MHD_NO (and I set *upload_data_size to 0)
Any advice?
Thanks
Avner