/**
* Convert a hash to a string (for printing debug messages).
- * This is one of the very few calls in the entire API that is
- * NOT reentrant!
*
* @param hc the hash code
* @return string form; will be overwritten by next call to GNUNET_h2s.
const char *
GNUNET_h2s (const struct GNUNET_HashCode * hc)
{
- static struct GNUNET_CRYPTO_HashAsciiEncoded ret;
+ static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret;
GNUNET_CRYPTO_hash_to_enc (hc, &ret);
ret.encoding[8] = '\0';
/**
* Convert a peer identity to a string (for printing debug messages).
- * This is one of the very few calls in the entire API that is
- * NOT reentrant!
*
* @param pid the peer identity
* @return string form of the pid; will be overwritten by next
const char *
GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
{
- static char buf[5];
+ static GNUNET_THREAD_LOCAL char buf[5];
char *ret;
if (NULL == pid)
/**
* Convert a peer identity to a string (for printing debug messages).
- * This is one of the very few calls in the entire API that is
- * NOT reentrant! Identical to #GNUNET_i2s(), except that another
+ * Identical to #GNUNET_i2s(), except that another
* buffer is used so both #GNUNET_i2s() and #GNUNET_i2s2() can be
* used within the same log statement.
*
const char *
GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid)
{
- static char buf[5];
+ static GNUNET_THREAD_LOCAL char buf[5];
char *ret;
if (NULL == pid)
/**
* Convert a peer identity to a string (for printing debug messages).
- * This is one of the very few calls in the entire API that is
- * NOT reentrant!
*
* @param pid the peer identity
* @return string form of the pid; will be overwritten by next
const char *
GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid)
{
- static char buf[256];
+ static GNUNET_THREAD_LOCAL char buf[256];
char *ret;
ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);