cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: reagrding error in getting complete server response

From: Fahad Ashfaque <me_at_fahadash.com>
Date: Fri, 15 Nov 2013 22:31:13 -0500

Sunil,
He is saying that your output might contain a '\0' not '0' which might be
causing the termination of string. Since printf() stops printing when it
sees a \0. As an example

printf("This part of string will print but \0 this will never print");

What he is suggesting is , you printf() or save to file the HTTP-RESPONSE
headers, specifically the Content-Length header and see if length is
greater than the actual output. Or write some code to walk the whole
response and print it character by charactor, and stops at Content-Length

On Fri, Nov 15, 2013 at 7:01 PM, Sunil Chandrasekharan <
sunil.kainat_at_gmail.com> wrote:

>
> chunk.size and chunk.memory
>>>
>>> *chunk.size = 12076*
>>> *chunk.memory = it just prints a small section the first part upto the
>>> starting line of "iteration 1"*
>>>
>>
>> Because the data contains a binary zero somewhere in there, right? So
>> using printf() or _anything_ that assumes a terminating byte code is plain
>> wrong.
>>
>>
>>
>
> Hi Dan,
>
> Can you tell me what you meant. I didnt understand your response. binary
> zero?
> do you mean to say if the output contains any '0' ? it has lot of them as
> the environment variable prints IP address and toerh details , hence there
> are many 0s randomly occuring in the output.
>
> But is this what you meant? can you make it more clear
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-16