【问题标题】:Curl with HTTPS and Multithreading使用 HTTPS 和多线程进行卷曲
【发布时间】:2012-03-17 01:28:55
【问题描述】:

我正在尝试在 curl 的帮助下实现 HTTPS 支持。由于 HTTPS 不是线程安全的(openSSL 的 bcoz),我计划在 curl 调用中使用互斥锁。谁能建议我在 curl_easy_perform 单独调用之前和之后锁定和解锁是否安全,或者在设置 curl-options 之前应该锁定互斥锁??

平台:Linux,语言:C

提前谢谢.. :)

【问题讨论】:

    标签: multithreading ssl curl https mutex


    【解决方案1】:

    OpenSSL 是线程安全的,只要您向它提供回调函数,它需要创建它在多个线程中使用时需要使用的锁。

    见:http://www.openssl.org/docs/crypto/threads.html

    对于一些 OpenSSL 和 Curl 特定的想法,您可以在这里尝试:http://curl.haxx.se/mail/lib-2009-02/0378.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-21
      • 1970-01-01
      • 2013-04-04
      • 1970-01-01
      • 2012-10-19
      • 1970-01-01
      相关资源
      最近更新 更多