diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
commit | 9fac6b6eefdc9144053f736fd388cb2199a97046 (patch) | |
tree | 82740a981b7f6ae973d915aa77797acd9db668b2 /src/datacache/datacache.c | |
parent | 23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (diff) | |
download | gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.tar.gz gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.zip |
-removing legacy ifdefs, fixing log statements
Diffstat (limited to 'src/datacache/datacache.c')
-rw-r--r-- | src/datacache/datacache.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c index 936031b91..b440af1b2 100644 --- a/src/datacache/datacache.c +++ b/src/datacache/datacache.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include "gnunet_statistics_service.h" | 29 | #include "gnunet_statistics_service.h" |
30 | #include "gnunet_datacache_plugin.h" | 30 | #include "gnunet_datacache_plugin.h" |
31 | 31 | ||
32 | #define DEBUG_DATACACHE GNUNET_EXTRA_LOGGING | ||
33 | 32 | ||
34 | #define LOG(kind,...) GNUNET_log_from (kind, "datacache", __VA_ARGS__) | 33 | #define LOG(kind,...) GNUNET_log_from (kind, "datacache", __VA_ARGS__) |
35 | 34 | ||
@@ -108,10 +107,8 @@ env_delete_notify (void *cls, const GNUNET_HashCode * key, size_t size) | |||
108 | { | 107 | { |
109 | struct GNUNET_DATACACHE_Handle *h = cls; | 108 | struct GNUNET_DATACACHE_Handle *h = cls; |
110 | 109 | ||
111 | #if DEBUG_DATACACHE | ||
112 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Content under key `%s' discarded\n", | 110 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Content under key `%s' discarded\n", |
113 | GNUNET_h2s (key)); | 111 | GNUNET_h2s (key)); |
114 | #endif | ||
115 | GNUNET_assert (h->utilization >= size); | 112 | GNUNET_assert (h->utilization >= size); |
116 | h->utilization -= size; | 113 | h->utilization -= size; |
117 | GNUNET_CONTAINER_bloomfilter_remove (h->filter, key); | 114 | GNUNET_CONTAINER_bloomfilter_remove (h->filter, key); |
@@ -248,10 +245,8 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | |||
248 | GNUNET_break (0); | 245 | GNUNET_break (0); |
249 | return GNUNET_SYSERR; | 246 | return GNUNET_SYSERR; |
250 | } | 247 | } |
251 | #if DEBUG_DATACACHE | ||
252 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Stored data under key `%s' in cache\n", | 248 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Stored data under key `%s' in cache\n", |
253 | GNUNET_h2s (key)); | 249 | GNUNET_h2s (key)); |
254 | #endif | ||
255 | GNUNET_STATISTICS_update (h->stats, gettext_noop ("# bytes stored"), size, | 250 | GNUNET_STATISTICS_update (h->stats, gettext_noop ("# bytes stored"), size, |
256 | GNUNET_NO); | 251 | GNUNET_NO); |
257 | GNUNET_CONTAINER_bloomfilter_add (h->filter, key); | 252 | GNUNET_CONTAINER_bloomfilter_add (h->filter, key); |
@@ -280,20 +275,16 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, | |||
280 | { | 275 | { |
281 | GNUNET_STATISTICS_update (h->stats, gettext_noop ("# requests received"), 1, | 276 | GNUNET_STATISTICS_update (h->stats, gettext_noop ("# requests received"), 1, |
282 | GNUNET_NO); | 277 | GNUNET_NO); |
283 | #if DEBUG_DATACACHE | ||
284 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing request for key `%s'\n", | 278 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing request for key `%s'\n", |
285 | GNUNET_h2s (key)); | 279 | GNUNET_h2s (key)); |
286 | #endif | ||
287 | if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_test (h->filter, key)) | 280 | if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_test (h->filter, key)) |
288 | { | 281 | { |
289 | GNUNET_STATISTICS_update (h->stats, | 282 | GNUNET_STATISTICS_update (h->stats, |
290 | gettext_noop | 283 | gettext_noop |
291 | ("# requests filtered by bloom filter"), 1, | 284 | ("# requests filtered by bloom filter"), 1, |
292 | GNUNET_NO); | 285 | GNUNET_NO); |
293 | #if DEBUG_DATACACHE | ||
294 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Bloomfilter filters request for key `%s'\n", | 286 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Bloomfilter filters request for key `%s'\n", |
295 | GNUNET_h2s (key)); | 287 | GNUNET_h2s (key)); |
296 | #endif | ||
297 | return 0; /* can not be present */ | 288 | return 0; /* can not be present */ |
298 | } | 289 | } |
299 | return h->api->get (h->api->cls, key, type, iter, iter_cls); | 290 | return h->api->get (h->api->cls, key, type, iter, iter_cls); |