c++ - libcurl crashing program after execution? -


i using libcurl make request google server. curl library giving output , when use curl variables global every thing works fine when using curl variables local inside function or class private members program crashes. not able catch segmentaion fault occuring.

code is

void   func1(); { internet_connection_through_curl    internet_connection; internet_connection.simple_program(querry_url); }  internet_connection_through_curl::simple_program(string url) {     curl *curle;     curlcode rese;     curle = curl_easy_init();     if(curle)     {         curl_easy_setopt(curle, curlopt_url, url.c_str());         curl_easy_setopt(curle, curlopt_followlocation, 1l);         curl_easy_setopt(curle, curlopt_ssl_verifypeer, 0l);         curl_easy_setopt(curle, curlopt_ssl_verifyhost, 0l);         curl_easy_setopt(curle, curlopt_writedata , (void *)(&uf));         curl_easy_setopt(curle, curlopt_writefunction, writememorycallback);         curl_easy_setopt(curle, curlopt_headerfunction, headermemorycallback);         rese = curl_easy_perform(curle);         fprintf(stderr , "curl easy perform error----> %s\n" , curl_easy_strerror(rese));         if(rese != curle_ok)                fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(rese));         curl_easy_cleanup(curle);     } } 


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -