Hi Markus,

Let me get this straight:
The scenario you are concerned with is to distinguish the case that
there are possibly two variables with *identical* key / content-type
*values* and the first one has an 'empty' value, and the second case is
that there is just one value and you got called with size=0 merely
because of 'unfortunate' network traffic. Is that right?

If so, I don't think the current API allows you to _reliably_
distinguish those two cases (cmp'ing pointers is an unreliable hack, as
you say). It's an interesting corner case, which we may want to document
and/or fix in the v2.0 API -- unless someone has a good proposal for how
to do address this case in a binary-API compatible way.


Happy hacking!

Christian


On 4/21/20 4:17 PM, Markus Doppelbauer wrote:
> Hello,
> 
> Is there a reliable way to detect 'continution' in 'MHD_PostDataIterator()'?
> To detect the beginning of a new variable I have tested: 'off == 0'.
> But this is not reliable. It is a rare case but sometimes the iterator
> stops right
> before the first content-byte (if helpful I will provide a testcase):
> 
> first call:
> MHD_PostDataIterator( cls, kind=MHD_POSTDATA_KIND, key="upload-name",
> filename="video.mp4", content_type="video/mp4", transfer_encoding=nullptr,
> data=..., off=0, size=0 );
> 
> second call:
> MHD_PostDataIterator( cls, kind=MHD_POSTDATA_KIND, key="upload-name",
> filename="video.mp4", content_type="video/mp4", transfer_encoding=nullptr,
> data=..., off=0, size=64724 );
> 
> Pointer comparision of 'key', 'filename' and 'content_type' works - but
> is also not 100% reliable.
> 'malloc()' could provide the same address.
> 
> Thanks a lot
> Markus

Attachment: 0x939E6BE1E29FC3CC.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to