STEP1
CURL *curlhandle = NULL;
// curl_global_init(CURL_GLOBAL_ALL);
curlhandle = curl_easy_init();
bool flag = download(curlhandle,myvar->url.c_str(),myvar->path.c_str(),
myvar->proxy_address.c_str(),
myvar->proxy_port.c_str(),
myvar->username.c_str(),
myvar->password.c_str(),
1,3);
curl_easy_cleanup(curlhandle);
curl_global_cleanup();
STEP2
int ABCD::download(CURL *curlhandle,
const char * remotepath,
const char * localpath,
const char* proxy_address,
const char* proxy_port,
const char* username,
const char* password,
long timeout, long tries)
{
curl_off_t local_file_len = -1 ;
long filesize =0 ;
CURLcode res = CURLE_GOT_NOTHING;
int c;
struct stat file_info;
int use_res