Thread
:
What Is The Use Of libconic Api And How libconic and curl Http Are realted
View Single Post
lardman
2009-11-20 , 09:01
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#
4
// Following fn from liq*, thanks Gary/lcuk
static size_t curl_writebuffer(void *ptr, size_t size, size_t nmemb, void *data)
{
struct curl_memorybuffer *mem = (struct curl_memorybuffer *) data;
int realsize = size * nmemb;
printf("In memory write callback, size=%d\n", realsize);
mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
if (mem->memory){
memcpy(&(mem->memory[mem->size]), ptr, realsize);
mem->size += realsize;
mem->memory[mem->size] = 0;
}
return realsize;
}
Quote & Reply
|
The Following User Says Thank You to lardman For This Useful Post:
kamesh.smartdude
lardman
View Public Profile
Send a private message to lardman
Find all posts by lardman