libcurl增加错误处理

rtmpsuck
Matthew 5 months ago
parent 4e4904241c
commit dc2b8c1504

@ -65,6 +65,8 @@ int DoGetRequest(const char* url, int authType, const char* userName, const char
curl_easy_setopt(curl, CURLOPT_SOCKOPTDATA, &netHandle); curl_easy_setopt(curl, CURLOPT_SOCKOPTDATA, &netHandle);
} }
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_USERAGENT , "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36");
// //
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, OnWriteData); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, OnWriteData);
// 设置回调函数的参数,获取反馈信息 // 设置回调函数的参数,获取反馈信息

Loading…
Cancel
Save