Question about gnutls_global_set_log_function()

Nikos Mavrogiannopoulos nmav at gnutls.org
Sat Aug 18 09:21:34 CEST 2012


On 08/17/2012 09:06 PM, Murray S. Kucherawy wrote:

> I'm writing a multithreaded application that could be doing RSA
> signature generations and/or validations in parallel.
> 
> Right now gnutls_global_set_log_function() allows me to specify an
> error reporting function, but in theory any thread could call it.  It
> would be helpful to receive something thread-specific in the function
> I provide to gnutls_global_set_log_function() so that, for example, a
> buffer could be assigned per thread to receive this information.


Indeed. However this is a debugging function, not one that is typically
expected to run. Which error conditions do you try to catch using those?

The only related function I can see is
gnutls_global_set_audit_log_function() which supplies the session argument.

> As it stands right now I have to do something like a pthread_key to
> get thread-specific storage from the underlying threading
> implementation.  Not having that dependency would be desirable.  Being
> able to add gnutls_set_thread_specific() that stores a thread-specific
> pointer would be helpful, and then that could be done inside my global
> log function to take thread-specific action.


What do you mean? Where would the thread-specific pointer would be stored?

regards,
Nikos




More information about the Gnutls-help mailing list