libcurl偶尔会在curl_easy_perform崩溃

时间:2014-09-03 15:48:39

标签: c++ ios curl libcurl

我们使用以下代码将消息发送到服务器。假设URL很好,以下代码有什么问题吗?

任何帮助将不胜感激!谢谢!

代码

CURL *session = curl_easy_init();

curl_easy_setopt(session, CURLOPT_URL, requestData->url.c_str());
curl_easy_setopt(session, CURLOPT_TIMEOUT, kConfigServerReadTimeout);
curl_easy_setopt(session, CURLOPT_CONNECTTIMEOUT, kConfigServerConnectionTimeout);
curl_easy_setopt(session, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(session, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(session, CURLOPT_NOSIGNAL, 1L);
curl_easy_setopt(session, CURLOPT_POST, 1);
curl_easy_setopt(session, CURLOPT_POSTFIELDS, requestData->params.c_str());
curl_easy_setopt(session, CURLOPT_POSTFIELDSIZE, requestData->params.size());

CURLcode curl_code = curl_easy_perform(session);

崩溃日志:

libsystem_platform.dylib 0x3a6cd058 _platform_strcmp + 0

libsystem_info.dylib 0x3a64ac81 _mdns_query_callback + 162

libsystem_dnssd.dylib 0x3a63b9d9 handle_query_response + 166

libsystem_dnssd.dylib 0x3a63a73f DNSServiceProcessResult + 580

libsystem_info.dylib 0x3a64a4c3 _mdns_search + 828

libsystem_info.dylib 0x3a649e75 mdns_addrinfo + 286

libsystem_info.dylib 0x3a64b9df search_addrinfo + 112

libsystem_info.dylib 0x3a643787 si_addrinfo + 1052

libsystem_info.dylib 0x3a6432fb getaddrinfo + 100

澳门0x003a6b9f Curl_getaddrinfo_ex + 20

澳门0x003af70f Curl_ipv4_resolve_r + 132

澳门0x003af66d Curl_getaddrinfo + 18

澳门0x003af25f Curl_resolv + 244

澳门0x003af397 Curl_resolv_timeout + 220

澳门0x003c77bb Curl_connect + 6036

Macau 0x003c39d9 Curl_do_perform + 170

澳门0x003c38ff Curl_perform + 60

澳门0x003a8c67 curl_easy_perform + 12

0 个答案:

没有答案