cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl Limits max returned size to around 5700 - 5800

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 8 Mar 2011 09:14:31 +0100 (CET)

On Tue, 8 Mar 2011, hemanshupatel wrote:

> I am using google API's for picasa with curl. When i am using get album feed
> type everytime application runs it returns around 5700 to 5800 bytes data

So if you want to make a HTTP GET, why not just use something like:

         http://curl.haxx.se/libcurl/c/getinmemory.html

> curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
> res = curl_easy_perform(curl);
> curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockextr);

This is quite literally saying: I don't want to speak a protocol that libcurl
supports but I will instead take over and do all the socket level details
myself. And when you say that, you also can no longer ask us for help since
you're not using libcurl for the protocols libcurl is written to support.

> res = curl_easy_recv(curl, buf, 18095, &iolen);
>
> if(CURLE_OK != res)
> break;

Read the "RETURN VALUE" section again in the docs:

         http://curl.haxx.se/libcurl/c/curl_easy_recv.html

> strcat(XML,buf);

Disaster. You will not get a zero terminated buffer.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-08