-consistently use struct GNUNET_HashCode
[oweals/gnunet.git] / src / datacache / datacache.c
index 936031b91f07555715cc01d414624e92f8076fb3..9087ae0dd21b0352cf8b563046dd8d9316a24569 100644 (file)
@@ -29,7 +29,6 @@
 #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,14 +103,12 @@ struct GNUNET_DATACACHE_Handle
  * @param size number of bytes that were made available
  */
 static void
-env_delete_notify (void *cls, const GNUNET_HashCode * key, size_t size)
+env_delete_notify (void *cls, const struct GNUNET_HashCode * key, size_t size)
 {
   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);
@@ -236,7 +233,7 @@ GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h)
  */
 int
 GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
-                      const GNUNET_HashCode * key, size_t size,
+                      const struct GNUNET_HashCode * key, size_t size,
                       const char *data, enum GNUNET_BLOCK_Type type,
                       struct GNUNET_TIME_Absolute discard_time)
 {
@@ -248,10 +245,8 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
     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);
@@ -275,25 +270,21 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
  */
 unsigned int
 GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
-                      const GNUNET_HashCode * key, enum GNUNET_BLOCK_Type type,
+                      const struct GNUNET_HashCode * key, enum GNUNET_BLOCK_Type type,
                       GNUNET_DATACACHE_Iterator iter, void *iter_cls)
 {
   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);