Closed lbirkert closed 3 years ago
If you use MHD_queue_response()
before reading the request in full, MHD treats it as a signal "response is generated, application do not need the client upload" and discards the rest of the upload.
You have a several ways to get full client upload:
MHD_AccessHandlerCallback()
will be called again with NULL as upload_data
, you should provide response by MHD_queue_response()
. Do not forget to destroy response once you queued it.MHD_create_response_from_xxx()
, optionally enrich it by MHD_add_response_header()
, and store it somewhere. You can create static response to be (re-)used for replies, or generate it for one time use only. If you generate response in your MHD_AccessHandlerCallback()
you can use *con_cls
pointer to store response. After you process the last part of the upload data, you can use MHD_queue_response()
with pre-generated response.Does it answer your needs?
Thanks a lot. Yeah it works now ^^
Im using libmicrohttpd to make an upload service and all i need is get the post data as a buffer (char*). But i have to firstly return MHD_YES and then i get access to the data, the problem is i have to submit the response before i get the data. How do i do that?