[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Simple question about multithreading SSL bufferevents.



Mark,

Yes, I have enabled OpenSSL locking, including setting up dynamic locking. I have verified the locks are "running" by watching the various lock callbacks occuring. I "stole" the locking code from the book "Network Security with OpenSSL", by Viega/Messier/Chandra.

Thanks,
-John


----- Original Message -----
From: Mark Ellzey <mthomas@xxxxxxxxxx>
To: libevent-users@xxxxxxxxxxxxx
Cc: 
Sent: Wednesday, March 27, 2013 7:23 AM
Subject: Re: [Libevent-users] Simple question about multithreading SSL bufferevents.

On Tue, Mar 26, 2013 at 03:32:17PM -0700, John wrote:
> Hello all,
> 
> I am having significant issues with (near immediate) deadlock when trying to send data out a single openssl bufferevent from two separate threads. The individual threads themselves send complete messages with each write. This should present no real problem from a synchronization perspective. In fact, the code works flawlessly when using ordinary bufferevents (not ssl bufferevents).
> 

Have you enabled OpenSSL locking? OpenSSL uses a myriad of global
variables and you have to initalize a set of mutexes and set lock/unlock
callbacks via ssl. See
https://github.com/ellzey/libevhtp/blob/master/evhtp.c#L3160 as an
example.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.