gnutls_handshake() thread problem

Jay Anra jay.janra at
Wed Nov 17 09:54:54 CET 2010

On 21 Oct I reported a problem I was having with inconsistent errors that
appeared to be connected with libgcrypt and asynchronous sockets.

It turns out the problem was not specifically libgcrypt but

What was happening was that the socket interrupt was calling
gnutls_handshake() with a response from the server, interrupting the
previous call to gnutls_handshake() that had not yet returned. The interrupt
call to gnutls_handshake() obviously conflicting with the previous
incomplete call to gnutls_handshake() and causing all sorts of inconsistent

I have used a mutex to protect gnutls_hansdshake() and the problems have
gone away.

Would it be possible to build protection into the library for this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20101117/fc1a7d77/attachment.htm>

More information about the Gnutls-help mailing list