cURL / Mailing Lists / curl-library / Single Mail


Re: reagrding error in getting complete server response

From: Sunil Chandrasekharan <>
Date: Mon, 18 Nov 2013 11:23:29 +0900

Hi All,

As discussed with Dan and Fahad, i checked the output..but i could see that
the "chunk.memory" ( as per the sample shown in the link is not getting truncated
exactly at a occurance of binary 0.

In my example...after getting the response this is what i am doing.

char * buffer;
if(res != CURLE_OK)
__android_log_print(ANDROID_LOG_DEBUG, "LOG_TAG", "curl_easy_perform()
failed: %s\n", curl_easy_strerror(res));
return (*env)->NewStringUTF(env,curl_easy_strerror(res));

__android_log_print(ANDROID_LOG_DEBUG, "LOG_TAG", "\n OUTPUT:content
length(%d)======\n", strlen(;
__android_log_print(ANDROID_LOG_DEBUG, "LOG_TAG", "\n OUTPUT:page
size(%d)======\n", page.len);
__android_log_print(ANDROID_LOG_DEBUG, "LOG_TAG", "\n OUTPUT:%s ======\n",;

buffer = (char *)malloc(2 * strlen(;
sprintf(buffer, "%ld:%s \n",response_code,;

(*env)->ReleaseStringUTFChars(env, webpageJStr, webpage);
return (*env)->NewStringUTF(env,buffer);
Kindly let me know if i am doing something wrong here?

2. this is the curl response for the content headers

curl -I http://33.33.33/ <>

HTTP/1.1 200 OK
Date: Thu, 14 Nov 2013 04:40:46 GMT
Server: Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19
Content-Type: text/plain; charset=utf-8

i cannot find a content length header here.

3. >>> write some code to walk the whole response and print it character
by charactor,
and stops at Content-Length

can you help me more how to do this in the given example.

Sunil C

List admin:
Received on 2013-11-18