您的位置:首页 > 其它

解决curl超时导致应用崩溃的问题

2015-03-24 15:31 323 查看
目前游戏用curl下载取版本数据,下载资源包之类的。

偶尔会发现在curl返回6,即CURLE_COULDNT_RESOLVE_HOST的时候,程序会崩溃。

网上查了下,在curl调用前,调用

curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);


即可解决此问题

google关键词:

curl reslove host crash

参考链接
http://curl.haxx.se/mail/archive-2008-05/0081.html http://stackoverflow.com/questions/13702408/curl-requests-in-pthread-crashes-after-completion-of-request http://discuss.cocos2d-x.org/t/curl-crashes-when-the-dns-try-to-resolve-the-host-but-exceeds-the-timout-of-curl/5335
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐