aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-03-08 16:36:35 +0000
committerBart Polot <bart@net.in.tum.de>2013-03-08 16:36:35 +0000
commit74f38f1751e9b91954a9b0cae6d845143de38354 (patch)
treec3b2a61e17e9f780e0d33629d5cf660a48e92455 /src/dht
parentcb20b54baf908feca1860220d879012b032f71b5 (diff)
downloadgnunet-74f38f1751e9b91954a9b0cae6d845143de38354.tar.gz
gnunet-74f38f1751e9b91954a9b0cae6d845143de38354.zip
- debug
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_datacache.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c
index 2b9c18542..c50b438fc 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -31,6 +31,8 @@
31#include "gnunet-service-dht_routing.h" 31#include "gnunet-service-dht_routing.h"
32#include "gnunet-service-dht.h" 32#include "gnunet-service-dht.h"
33 33
34#define LOG(kind,...) GNUNET_log_from (kind, "dht-dtcache",__VA_ARGS__)
35
34 36
35/** 37/**
36 * Handle to the datacache service (for inserting/retrieving data) 38 * Handle to the datacache service (for inserting/retrieving data)
@@ -77,9 +79,9 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration,
77 GNUNET_NO); 79 GNUNET_NO);
78 r = GNUNET_DATACACHE_put (datacache, key, data_size, data, type, expiration, 80 r = GNUNET_DATACACHE_put (datacache, key, data_size, data, type, expiration,
79 put_path_length, put_path); 81 put_path_length, put_path);
80 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 82 LOG (GNUNET_ERROR_TYPE_DEBUG,
81 "DATACACHE PUT for key %s [%u] completed (%d) after %u hops\n", 83 "DATACACHE PUT for key %s [%u] completed (%d) after %u hops\n",
82 GNUNET_h2s (key), data_size, r, put_path_length); 84 GNUNET_h2s (key), data_size, r, put_path_length);
83} 85}
84 86
85 87
@@ -149,9 +151,9 @@ datacache_get_iterator (void *cls,
149 GNUNET_BLOCK_evaluate (GDS_block_context, type, key, ctx->reply_bf, 151 GNUNET_BLOCK_evaluate (GDS_block_context, type, key, ctx->reply_bf,
150 ctx->reply_bf_mutator, ctx->xquery, 152 ctx->reply_bf_mutator, ctx->xquery,
151 ctx->xquery_size, data, size); 153 ctx->xquery_size, data, size);
152 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 154 LOG (GNUNET_ERROR_TYPE_DEBUG,
153 "Found reply for query %s in datacache, evaluation result is %d\n", 155 "Found reply for query %s in datacache, evaluation result is %d\n",
154 GNUNET_h2s (key), (int) eval); 156 GNUNET_h2s (key), (int) eval);
155 ctx->eval = eval; 157 ctx->eval = eval;
156 switch (eval) 158 switch (eval)
157 { 159 {
@@ -162,11 +164,11 @@ datacache_get_iterator (void *cls,
162 gettext_noop 164 gettext_noop
163 ("# Good RESULTS found in datacache"), 1, 165 ("# Good RESULTS found in datacache"), 1,
164 GNUNET_NO); 166 GNUNET_NO);
165 GDS_CLIENTS_handle_reply (exp, key, 0, NULL, put_path_length, put_path, type, 167 GDS_CLIENTS_handle_reply (exp, key, 0, NULL, put_path_length, put_path,
166 size, data); 168 type, size, data);
167 /* forward to other peers */ 169 /* forward to other peers */
168 GDS_ROUTING_process (type, exp, key, put_path_length, put_path, 0, NULL, data, 170 GDS_ROUTING_process (type, exp, key, put_path_length, put_path, 0, NULL,
169 size); 171 data, size);
170 break; 172 break;
171 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: 173 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
172 GNUNET_STATISTICS_update (GDS_stats, 174 GNUNET_STATISTICS_update (GDS_stats,
@@ -239,9 +241,9 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key,
239 ctx.reply_bf_mutator = reply_bf_mutator; 241 ctx.reply_bf_mutator = reply_bf_mutator;
240 r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator, 242 r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator,
241 &ctx); 243 &ctx);
242 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 244 LOG (GNUNET_ERROR_TYPE_DEBUG,
243 "DATACACHE GET for key %s completed (%d). %u resoutlf found.\n", 245 "DATACACHE GET for key %s completed (%d). %u results found.\n",
244 GNUNET_h2s (key), ctx.eval, r); 246 GNUNET_h2s (key), ctx.eval, r);
245 return ctx.eval; 247 return ctx.eval;
246} 248}
247 249