首页 > Web开发 > 详细

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

时间:2015-03-24 16:15:07      阅读:798      评论:0      收藏:0      [点我收藏+]

          目前游戏用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


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

原文:http://blog.csdn.net/piao_polar/article/details/44592609

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!