[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 07/19: introcude GNUNET_i2s2()
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 07/19: introcude GNUNET_i2s2() |
Date: |
Sun, 22 Jan 2017 15:23:48 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 02132e8fc311b966154fd5d9f0b3686ea8c2bf86
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 22 12:21:24 2017 +0100
introcude GNUNET_i2s2()
---
src/include/gnunet_common.h | 16 ++++++++++++++++
src/util/common_logging.c | 25 +++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 9ad604711..fdcae66fa 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -614,6 +614,22 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
* @ingroup logging
* 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
+ * buffer is used so both #GNUNET_i2s() and #GNUNET_i2s2() can be
+ * used within the same log statement.
+ *
+ * @param pid the peer identity
+ * @return string form of the pid; will be overwritten by next
+ * call to #GNUNET_i2s().
+ */
+const char *
+GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid);
+
+
+/**
+ * @ingroup logging
+ * 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
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index ce229826e..dad5d3776 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -1220,6 +1220,31 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *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
+ * buffer is used so both #GNUNET_i2s() and #GNUNET_i2s2() can be
+ * used within the same log statement.
+ *
+ * @param pid the peer identity
+ * @return string form of the pid; will be overwritten by next
+ * call to #GNUNET_i2s.
+ */
+const char *
+GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid)
+{
+ static char buf[256];
+ char *ret;
+
+ ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
+ strcpy (buf, ret);
+ GNUNET_free (ret);
+ buf[4] = '\0';
+ return buf;
+}
+
+
+/**
+ * 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
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 11/19: fix buffer size, (continued)
- [GNUnet-SVN] [gnunet] 11/19: fix buffer size, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 04/19: fix startup interaction between channel and tunnel to not send CHANNEL_OPEN until tunnel is in KEY_OK state, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 18/19: nicer logging, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 10/19: make GCPP_2s also return static string, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 12/19: fix a few off-by-ones, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 02/19: do not run upnpc during tests, produces unnecessary errors if not available, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 16/19: nicer order of LOG statements, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 13/19: properly launch DHT GETs based on need for paths, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 17/19: must delay iteration over paths until later, as we may be right now creating a connection, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 19/19: must not move location of -struct CadetPeerPathEntry- in memory when growing path length as those structs are also referenced from a DLL, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 07/19: introcude GNUNET_i2s2(),
gnunet <=
- [GNUnet-SVN] [gnunet] 14/19: fix indentation, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 15/19: minor cleanup, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 09/19: more logging for cadet-core subsystem, gnunet, 2017/01/22
- [GNUnet-SVN] [gnunet] 06/19: improving logging, gnunet, 2017/01/22