cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl failures at a multi-threading application

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 13 Sep 2011 16:28:32 -0700

On Mon, Sep 05, 2011 at 08:28:14PM +0000, Yamin Zhou wrote:
> curl_global_init() gets called before starting worker threads.
> though curl here only deals with HTTP POST requests, below SSL related options are set in code.
> curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYPEER, 0);
> curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYHOST, 1);
> curl_easy_setopt(m_curl, CURLOPT_SSLENGINE_DEFAULT, 1);
> But besides curl worker threads, there are some other threads using SSL, and in those threads curl_easy_escape, only this curl API, is called. Problem in there?

curl_easy_escape takes an easy handle as a parameter, and an easy handle is
not allowed to be shared between threads. Note also that those arguments
to curl_easy_setopt shown above must be long ints, not plain ints.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-14