cURL / Mailing Lists / curl-library / Single Mail

curl-library

OpenSSL multi-threading

From: dfg sdf <prac89_at_yahoo.com>
Date: Sat, 9 Oct 2004 10:48:30 -0700 (PDT)

I'm using libcurl to retrieve pages from my webserver.
I am using the boost threads library for my threads,
and I use https so I think I need to know how to use
OpenSSL locks, I have read this:
http://www.openssl.org/docs/crypto/threads.html and I
have seen the example mttest.c, however I don't
understand how they work.

This is the sample of my code which does the transfer:

curl_easy_setopt(curl, CURLOPT_URL,
"https://test.html");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
process_data);
curl_easy_setopt(curl, CURLOPT_FILE, &s);
curl_easy_perform(curl);

The function which crashes is curl_easy_perform() of
course, but if I lock that whole function with boost
locks the retrieval becomes very slow. The program
works fine with one thread only, and after reading
this: "dyn_create_function(const char *file, int line)
is needed to create a lock. Multi-threaded
applications might crash at random if it is not set."
from the openssl website I think that may be the
cause, however I don't know what "setting" that
function means, nor how to set it.

How can I use my code sample so that it doesn't crash
but also doesnt become very slow? If the problem
really is openssl locking then if someone could please
write a small sample of how openssl locks work in
practice, that would be perfect.
I am on windows, using mingw compiler.
Very nice library by the way.
Thank you very much.
JP

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on 2004-10-10