while I'm calling curl_easy_perform() it's crashing and I'm getting "SSL read: error:00000000:lib(0):func(0):reason(0), errno 110". Need help to resolve this.
NOTE: After curl_easy_perform sends http1.1 command and before it receives http 200 OK, if internet is disconnected then this error comes.
if (curl) {
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, read_data);
//url_easy_setopt(curl, CURLOPT_WRITEDATA, client);
curl_easy_setopt(curl, CURLOPT_URL, "https://***.com:1027/page");
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
printf("sending perform request\n");
try{
res = curl_easy_perform(curl); // Perform the request, res will get the return code
printf("%s",curl_easy_strerror(res));
}catch(int e){
printf("catch the error\n");
fflush(stdout);
}
printf("perform done");
if (res != CURLE_OK) { /* Check for errors */
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
printf(" Uploading failed \n");
fflush(stdout);
result = 0;
}