cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Data retrieval is fragmented using Multi CURL Lib

From: doa379 <doa379_at_gmail.com>
Date: Sat, 07 Nov 2015 12:26:35 +0000

>> I am using multi libcurl to download data from various sources. It's
>> all working except for the issue that the data retrieved from the
>> various sources is fragmented and jumbled. For example if you have
>> this JSON data in any order:
>>
>> {{ JSON1 }, { JSON2 }, { JSON3 }}
>> {{ JSON1 }, { JSON3 }, { JSON2 }}
>> {{ JSON2 }, { JSON1 }, { JSON3 }}
>> .
>> .
>> .
>>
>>
>> it may appear in the resulting stream like this:
>>
>> {{ JSON1, { JSON3 }}, { JSON2 }}
>>
>> All the data is successfully downloaded but just in the wrong order.
>> As it makes parsing the data difficult I would like to resolve this
>> issue.
>
> Please review the bug reporting requirements [1]. Also ... if you can
> give a self contained compilable example that can be used to reproduce
> your problem that would be great.
>
> If you are receiving JSON from different handles and it is jumbled I
> wonder if maybe your write function is using the same location for more
> than one handle? It sounds like an issue with your write function.
>
>

This is not a CURL bug. Yes the write function is writing to the same
buffer using multiple handles.

Would the suggestion be to use multiple buffers corresponding to each
handle?

I would prefer to keep it simple and use a single buffer but rather have
the writes ordered using some way.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-11-07