gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17717 - gnunet/src/datacache


From: gnunet
Subject: [GNUnet-SVN] r17717 - gnunet/src/datacache
Date: Mon, 24 Oct 2011 14:22:54 +0200

Author: grothoff
Date: 2011-10-24 14:22:54 +0200 (Mon, 24 Oct 2011)
New Revision: 17717

Modified:
   gnunet/src/datacache/datacache.c
Log:
more logging

Modified: gnunet/src/datacache/datacache.c
===================================================================
--- gnunet/src/datacache/datacache.c    2011-10-24 12:10:00 UTC (rev 17716)
+++ gnunet/src/datacache/datacache.c    2011-10-24 12:22:54 UTC (rev 17717)
@@ -29,6 +29,8 @@
 #include "gnunet_statistics_service.h"
 #include "gnunet_datacache_plugin.h"
 
+#define DEBUG_DATACACHE GNUNET_EXTRA_LOGGING
+
 #define LOG(kind,...) GNUNET_log_from (kind, "datacache", __VA_ARGS__)
 
 /**
@@ -104,6 +106,11 @@
 {
   struct GNUNET_DATACACHE_Handle *h = cls;
 
+#if DEBUG_DATACACHE
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Content under key `%s' discarded\n",
+       GNUNET_h2s (key));
+#endif
   GNUNET_assert (h->utilization >= size);
   h->utilization -= size;
   GNUNET_CONTAINER_bloomfilter_remove (h->filter, key);
@@ -227,12 +234,18 @@
 {
   uint32_t used;
 
+
   used = h->api->put (h->api->cls, key, size, data, type, discard_time);
   if (used == 0)
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
+#if DEBUG_DATACACHE
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Stored data under key `%s' in cache\n",
+       GNUNET_h2s (key));
+#endif
   GNUNET_STATISTICS_update (h->stats, gettext_noop ("# bytes stored"), size,
                             GNUNET_NO);
   GNUNET_CONTAINER_bloomfilter_add (h->filter, key);
@@ -261,12 +274,22 @@
 {
   GNUNET_STATISTICS_update (h->stats, gettext_noop ("# requests received"), 1,
                             GNUNET_NO);
+#if DEBUG_DATACACHE
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Processing request for key `%s'\n",
+       GNUNET_h2s (key));
+#endif
   if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_test (h->filter, key))
   {
     GNUNET_STATISTICS_update (h->stats,
                               gettext_noop
                               ("# requests filtered by bloom filter"), 1,
                               GNUNET_NO);
+#if DEBUG_DATACACHE
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "Bloomfilter filters request for key `%s'\n",
+        GNUNET_h2s (key));
+#endif
     return 0;                   /* can not be present */
   }
   return h->api->get (h->api->cls, key, type, iter, iter_cls);




reply via email to

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