gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (4cc09ba10 -> 5bb2565ba)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (4cc09ba10 -> 5bb2565ba)
Date: Tue, 14 Aug 2018 11:17:37 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository gnunet.

    from 4cc09ba10 fixed makefile for plugin_rest_gns, json_generator
     new ba30221f3 introduce allocation wrappers to improve libgcrypt 
performance
     new 97e725212 fix build order: peerinfo logic depending on transport must 
be in peerinfo-tool
     new 5bb2565ba resolve merge conflict with peerinfo plugin move

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/peerinfo-tool/Makefile.am |  2 ++
 src/peerinfo/Makefile.am      |  6 ++---
 src/util/common_logging.c     | 51 ++++++++++++++++++++++++-------------------
 src/util/crypto_random.c      | 31 +++++++++++++++++++++++++-
 4 files changed, 63 insertions(+), 27 deletions(-)

diff --git a/src/peerinfo-tool/Makefile.am b/src/peerinfo-tool/Makefile.am
index 648957a05..429224650 100644
--- a/src/peerinfo-tool/Makefile.am
+++ b/src/peerinfo-tool/Makefile.am
@@ -10,6 +10,8 @@ if USE_COVERAGE
   XLIB = -lgcov
 endif
 
+plugindir = $(libdir)/gnunet
+
 bin_PROGRAMS = \
  gnunet-peerinfo
 
diff --git a/src/peerinfo/Makefile.am b/src/peerinfo/Makefile.am
index 3f68becb5..ef79d6720 100644
--- a/src/peerinfo/Makefile.am
+++ b/src/peerinfo/Makefile.am
@@ -5,8 +5,6 @@ pkgcfgdir= $(pkgdatadir)/config.d/
 
 libexecdir= $(pkglibdir)/libexec/
 
-plugindir = $(libdir)/gnunet
-
 pkgcfg_DATA = \
   peerinfo.conf
 
@@ -38,12 +36,12 @@ libexec_PROGRAMS = \
  gnunet-service-peerinfo
 
 gnunet_service_peerinfo_SOURCES = \
- gnunet-service-peerinfo.c
+  gnunet-service-peerinfo.c
 gnunet_service_peerinfo_LDADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la
-  
+
 if HAVE_BENCHMARKS
  PEERINFO_BENCHMARKS = \
  perf_peerinfo_api
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index f875d165d..be2e084b5 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -11,7 +11,7 @@
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -817,32 +817,39 @@ output_message (enum GNUNET_ErrorType kind,
   if ( (NULL != GNUNET_stderr) &&
        (NULL == loggers) )
   {
-    if (kind == GNUNET_ERROR_TYPE_MESSAGE) {
-       /* The idea here is to produce "normal" output messages
-        * for end users while still having the power of the
-        * logging engine for developer needs. So ideally this
-        * is what it should look like when CLI tools are used
-        * interactively, yet the same message shouldn't look
-        * this way if the output is going to logfiles or robots
-        * instead. Is this the right place to do this? --lynX
-        */
-       FPRINTF (GNUNET_stderr,
-             "* %s",
-             msg);
-    } else {
-       FPRINTF (GNUNET_stderr,
-             "%s %s %s %s",
-             datestr,
-             comp,
-             GNUNET_error_type_to_string (kind),
-             msg);
+    if (kind == GNUNET_ERROR_TYPE_MESSAGE)
+    {
+      /* The idea here is to produce "normal" output messages
+       * for end users while still having the power of the
+       * logging engine for developer needs. So ideally this
+       * is what it should look like when CLI tools are used
+       * interactively, yet the same message shouldn't look
+       * this way if the output is going to logfiles or robots
+       * instead.
+       */
+      FPRINTF (GNUNET_stderr,
+               "* %s",
+               msg);
+    }
+    else
+    {
+      FPRINTF (GNUNET_stderr,
+               "%s %s %s %s",
+               datestr,
+               comp,
+               GNUNET_error_type_to_string (kind),
+               msg);
     }
     fflush (GNUNET_stderr);
   }
   pos = loggers;
-  while (pos != NULL)
+  while (NULL != pos)
   {
-    pos->logger (pos->logger_cls, kind, comp, datestr, msg);
+    pos->logger (pos->logger_cls,
+                 kind,
+                 comp,
+                 datestr,
+                 msg);
     pos = pos->next;
   }
 #if WINDOWS
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index 2163a9731..df6d3fb9b 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -11,7 +11,7 @@
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -269,6 +269,28 @@ GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, 
uint64_t max)
 
 
 /**
+ * Allocation wrapper for libgcrypt, used to avoid bad locking
+ * strategy of libgcrypt implementation.
+ */
+static void *
+w_malloc (size_t n)
+{
+  return calloc (n, 1);
+}
+
+
+/**
+ * Allocation wrapper for libgcrypt, used to avoid bad locking
+ * strategy of libgcrypt implementation.
+ */
+static int
+w_check (const void *p)
+{
+  return 0; /* not secure memory */
+}
+
+
+/**
  * Initialize libgcrypt.
  */
 void __attribute__ ((constructor))
@@ -283,6 +305,13 @@ GNUNET_CRYPTO_random_init ()
              NEED_LIBGCRYPT_VERSION);
     GNUNET_assert (0);
   }
+  /* set custom allocators */
+  gcry_set_allocation_handler (&w_malloc,
+                               &w_malloc,
+                               &w_check,
+                               &realloc,
+                               &free);
+  /* Disable use of secure memory */
   if ((rc = gcry_control (GCRYCTL_DISABLE_SECMEM, 0)))
     FPRINTF (stderr,
              "Failed to set libgcrypt option %s: %s\n",

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]