curl-library
Re: AIX multithreaded problem in CURLE_SSL_CONNECT_ERROR,why?
Date: Tue, 16 Nov 2004 17:42:32 +0800
----- Original Message -----
From: "Daniel Stenberg" <daniel-curl_at_haxx.se>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Tuesday, November 16, 2004 4:47 PM
Subject: Re: AIX multithreaded problem in CURLE_SSL_CONNECT_ERROR,why?
> On Tue, 16 Nov 2004, hzhijun wrote:
>
> > i think it maybe no need to set the OpenSSL multithread-callbacks for
> > locking in my program since i only use easy curl handle in multithread
> > program,and my callback function set by
> > curl_easy_setopt(CURLOPT_WRITEFUNCTION) use the memory realloced by each
> > thread seperately.
>
> Did you really read that OpenSSL page? Allow me to quote a little piece:
>
> "locking_function... is needed to perform locking on shared data structures.
> (Note that OpenSSL uses a number of global data structures that will be
> implicitly shared whenever multiple threads use OpenSSL.) Multi-threaded
> applications will crash at random if it is not set."
>
> I would say you are FORCED to adhere to this if you want things to work.
>
Thanks Daniel, I have found the reason!If OpenSSL is *not* compiler with correct switches for multithreading,that would explain -- in that case, SSL_get_error() could be readingthe wrong copy of errno and thus not find the EWOULDBLOCK/EAGAIN codeSo, i replace the default compiler in AIX found by openssl auto configure and it works fine to use libcurl with ssl.Anyway, i don't think it need to set locking_function since i did not use any shared datastructures in my application. Although OpenSSL uses many global data structures, all i have to do is use the proper compiler to build OpenSSL with multithread options.
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-11-16