Brady Moritz wrote:

> I must be blind, as my mouse scroll button zoomed right past the source code
> versions down to the binary versions.
>
> I am needing something that can support multithreading, so Im not sure
> offhand that this will be helpful, as I would imagine cURL is meant for
> single-thread use (comma

Use curl as a template or s_client.c and add the thread callback functions
described in mttest.c (use the code ifdef'd for POSIX threads), then get the
pthreads32 package from opensource.cygnus.com. This gives you all the pieces of
the puzzle. Beware that the SSL * structure should not be shared between
threads (as in one for reading and one for writing)--use non-blocking
I/O instead in one thread.

The mt-safety of SSL is one of the perennial FAQs on openssl-users. Everyone
always asks, is it mt-safe? And the answer they get is, yes with the proper
locking. But the thing most people want to do with threads is have one thread
read from the socket and one write to the socket so they can implement a clean
pattern for multiplexing.  This cannot be done as has been attested by
innumerable threads on the subject. I think the main issue is keeping state on
error handling. SSL_read() may set an error condition that SSL_write() would
see. It would be nice if the state engine was mt-safe, but that is not the case
right now.

Brad



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to