gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (f13af7e72 -> c51a44aa2)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (f13af7e72 -> c51a44aa2)
Date: Sun, 06 May 2018 21:16:47 +0200

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

grothoff pushed a change to branch master
in repository gnunet.

    from f13af7e72 Merge branch 'master' of gnunet.org:gnunet
     new 99cddd695 typos
     new c51a44aa2 fix datacache bytes stored calculation

The 2 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/datacache/datacache.c               | 40 ++++++++++++++++++++++-----------
 src/datacache/plugin_datacache_sqlite.c |  3 ++-
 src/dht/gnunet_dht_profiler.c           |  6 ++---
 3 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c
index 92cc40b53..0646019bd 100644
--- a/src/datacache/datacache.c
+++ b/src/datacache/datacache.c
@@ -170,10 +170,14 @@ GNUNET_DATACACHE_create (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
   ret = GNUNET_new (struct GNUNET_DATACACHE_Handle);
 
   if (GNUNET_YES !=
-      GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "DISABLE_BF"))
+      GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                            section,
+                                            "DISABLE_BF"))
   {
     if (GNUNET_YES !=
-       GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "DISABLE_BF_RC"))
+       GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                              section,
+                                              "DISABLE_BF_RC"))
     {
       ret->bloom_name = GNUNET_DISK_mktemp ("gnunet-datacachebloom");
     }
@@ -230,7 +234,9 @@ GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h)
   if (NULL != h->filter)
     GNUNET_CONTAINER_bloomfilter_free (h->filter);
   if (NULL != h->api)
-    GNUNET_break (NULL == GNUNET_PLUGIN_unload (h->lib_name, h->api));
+    GNUNET_break (NULL ==
+                  GNUNET_PLUGIN_unload (h->lib_name,
+                                        h->api));
   GNUNET_free (h->lib_name);
   GNUNET_free (h->short_name);
   GNUNET_free (h->section);
@@ -243,7 +249,8 @@ GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h)
                                      h->bloom_name);
     GNUNET_free (h->bloom_name);
   }
-  GNUNET_STATISTICS_destroy (h->stats, GNUNET_NO);
+  GNUNET_STATISTICS_destroy (h->stats,
+                             GNUNET_NO);
   GNUNET_free (h);
 }
 
@@ -273,10 +280,14 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
 {
   ssize_t used;
 
-  used = h->api->put (h->api->cls, key,
-                     data_size, data,
-                     type, discard_time,
-                     path_info_len, path_info);
+  used = h->api->put (h->api->cls,
+                      key,
+                     data_size,
+                      data,
+                     type,
+                      discard_time,
+                     path_info_len,
+                      path_info);
   if (-1 == used)
   {
     GNUNET_break (0);
@@ -290,16 +301,17 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Stored data under key `%s' in cache\n",
        GNUNET_h2s (key));
+  if (NULL != h->filter)
+    GNUNET_CONTAINER_bloomfilter_add (h->filter,
+                                      key);
   GNUNET_STATISTICS_update (h->stats,
                             gettext_noop ("# bytes stored"),
-                            data_size,
+                            used,
                             GNUNET_NO);
   GNUNET_STATISTICS_update (h->stats,
                             gettext_noop ("# items stored"),
                             1,
                             GNUNET_NO);
-  if (NULL != h->filter)
-    GNUNET_CONTAINER_bloomfilter_add (h->filter, key);
   while (h->utilization + used > h->env.quota)
     GNUNET_assert (GNUNET_OK == h->api->del (h->api->cls));
   h->utilization += used;
@@ -345,8 +357,10 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
     return 0;                   /* can not be present */
   }
   return h->api->get (h->api->cls,
-                      key, type,
-                      iter, iter_cls);
+                      key,
+                      type,
+                      iter,
+                      iter_cls);
 }
 
 
diff --git a/src/datacache/plugin_datacache_sqlite.c 
b/src/datacache/plugin_datacache_sqlite.c
index dd79d0125..15438b29b 100644
--- a/src/datacache/plugin_datacache_sqlite.c
+++ b/src/datacache/plugin_datacache_sqlite.c
@@ -138,7 +138,8 @@ sq_prepare (sqlite3 *dbh,
   char *dummy;
 
   return sqlite3_prepare (dbh,
-                          zSql, strlen (zSql),
+                          zSql,
+                          strlen (zSql),
                           ppStmt,
                           (const char **) &dummy);
 }
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c
index 12e99f65d..bc75b67f5 100644
--- a/src/dht/gnunet_dht_profiler.c
+++ b/src/dht/gnunet_dht_profiler.c
@@ -360,11 +360,11 @@ bandwidth_stats_cont (void *cls,
                       const char *emsg)
 {
   MESSAGE ("# Outgoing bandwidth: %llu\n",
-        (unsigned long long) outgoing_bandwidth);
+           (unsigned long long) outgoing_bandwidth);
   MESSAGE ("# Incoming bandwidth: %llu\n",
-        (unsigned long long) incoming_bandwidth);
+           (unsigned long long) incoming_bandwidth);
   fprintf (stderr,
-           "Benchmark done. Collect data via gnunet-statisics, then press 
ENTER to exit.\n");
+           "Benchmark done. Collect data via gnunet-statistics, then press 
ENTER to exit.\n");
   getchar ();
   GNUNET_SCHEDULER_shutdown ();
 }

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



reply via email to

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