Wednesday, 15 July 2015

libcurl - libssl read error 131 causing an application crash -



libcurl - libssl read error 131 causing an application crash -

i have developed application uploads file dropbox. using libcurl (libcurl-7.21.7) , openssl (0.9.8e) api’s upload file dropbox. have noticed application crashing because of server unresponsiveness. error on console

ssl read: error:00000000:lib(0):func(0):reason(0), errno 131 closing connection #0

i have implemented curl_timeout in post request still facing crash. if time out little continuously upload errors, , if it's long application crashes giving above error. there way address issue seen in request avoid crash??

on debugging farther found crash happening in ssl library becaus of application crashes.

please can lite thrown on this??

code using :

curl *curl; curl = curl_easy_init(); curl_global_init(curl_global_all); curl_easy_setopt(curl, curlopt_cainfo, null); curl_easy_setopt(curl, curlopt_capath, null); curl_easy_setopt(curl, curlopt_ssl_verifyhost, 2); curl_easy_setopt(curl, curlopt_ssl_verifypeer, 0); curl_easy_setopt(curl, curlopt_url,notificationurl); curl_easy_setopt(curl, curlopt_post, 1l); curl_easy_setopt(curl, curlopt_forbid_reuse,1); curl_easy_setopt(curl, curlopt_postfields,data()); curl_easy_setopt(curl, curlopt_postfieldsize, datalength); curl_easy_setopt(curl, curlopt_httpheader, headers); long int maxconnectiontime = 600; curl_easy_setopt(curl, curlopt_connecttimeout,maxconnectiontime); long int maxtime = 1200; curl_easy_setopt(curl, curlopt_timeout,maxtime); curl_easy_setopt(curl, curlopt_verbose, 1l); res = curl_easy_perform(curl); if(res) { log("\n ncurl error curl_easy_perform homecoming %s [%d]",curl_easy_strerror(res),res); } curl_slist_free_all(headers); curl_global_cleanup(); curl_easy_cleanup(curl);

the problem can solved adding signals "sigpipe" , sigalrm" in client code , ignore.

libcurl libssl

No comments:

Post a Comment