cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: threading issue

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 26 Jul 2005 23:37:08 +0200 (CEST)

On Tue, 26 Jul 2005, Arnaud Compan wrote:

> I think I have encountered the same problem. It happens when you have
> multiple threads doing HTTPS requests simultaneously.

Guys. You talk very low-level libcurl talk. We have the curl-library mailing
list setup especially for that. You'll reach many more fellow libcurl
programmers there.

I'm cc'ing this reply over there and I trust you take follow-ups to that list
(only).

> The problem is that in cURL, this initialisation is protected by a static
> global variable (ssl_seeded in lib/ssluse.c). When many threads start
> requests at the same time, they all check the ssl_seeded value and they all
> call the random_the_seed() function. What I have done is to toggle the
> initial value of ssl_seeded to TRUE and to ensure myself that OpenSSL is
> correctly seeded before doing any request (call RAND_screen() for example on
> Windows). It's not a very good patch but it works.

Hm. Would it suffice for your case if we made the iniy variable a true global?
Or do you have any other suggestions on how to fix this problem the best
possible way?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-07-26