aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-22 23:05:17 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-22 23:05:17 +0000
commit6adc56da2017c1ca6cb2f167d209922f431bd525 (patch)
tree7af27ea7a1adbfa48ed7d13d2b4fa11c243653eb /src/dht
parentf0b8d172c71f56f4ef9dffb2fdab60a4148bc928 (diff)
downloadgnunet-6adc56da2017c1ca6cb2f167d209922f431bd525.tar.gz
gnunet-6adc56da2017c1ca6cb2f167d209922f431bd525.zip
-eliminating legacy DEBUG ifdefs
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index cfcedcc92..22c69f10d 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -524,11 +524,9 @@ add_known_to_bloom (void *cls, const GNUNET_HashCode * key, void *value)
524 GNUNET_HashCode mh; 524 GNUNET_HashCode mh;
525 525
526 GNUNET_BLOCK_mingle_hash (key, ctx->bf_mutator, &mh); 526 GNUNET_BLOCK_mingle_hash (key, ctx->bf_mutator, &mh);
527#if DEBUG_DHT
528 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 527 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
529 "Adding known peer (%s) to bloomfilter for FIND PEER with mutation %u\n", 528 "Adding known peer (%s) to bloomfilter for FIND PEER with mutation %u\n",
530 GNUNET_h2s (key), ctx->bf_mutator); 529 GNUNET_h2s (key), ctx->bf_mutator);
531#endif
532 GNUNET_CONTAINER_bloomfilter_add (ctx->bloom, &mh); 530 GNUNET_CONTAINER_bloomfilter_add (ctx->bloom, &mh);
533 return GNUNET_YES; 531 return GNUNET_YES;
534} 532}
@@ -615,10 +613,8 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
615 /* Check for connect to self message */ 613 /* Check for connect to self message */
616 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) 614 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity)))
617 return; 615 return;
618#if DEBUG_DHT
619 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected %s to %s\n", 616 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected %s to %s\n",
620 GNUNET_i2s (&my_identity), GNUNET_h2s (&peer->hashPubKey)); 617 GNUNET_i2s (&my_identity), GNUNET_h2s (&peer->hashPubKey));
621#endif
622 if (GNUNET_YES == 618 if (GNUNET_YES ==
623 GNUNET_CONTAINER_multihashmap_contains (all_known_peers, 619 GNUNET_CONTAINER_multihashmap_contains (all_known_peers,
624 &peer->hashPubKey)) 620 &peer->hashPubKey))
@@ -675,10 +671,8 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
675 /* Check for disconnect from self message */ 671 /* Check for disconnect from self message */
676 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) 672 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity)))
677 return; 673 return;
678#if DEBUG_DHT
679 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnected %s from %s\n", 674 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnected %s from %s\n",
680 GNUNET_i2s (&my_identity), GNUNET_h2s (&peer->hashPubKey)); 675 GNUNET_i2s (&my_identity), GNUNET_h2s (&peer->hashPubKey));
681#endif
682 to_remove = 676 to_remove =
683 GNUNET_CONTAINER_multihashmap_get (all_known_peers, &peer->hashPubKey); 677 GNUNET_CONTAINER_multihashmap_get (all_known_peers, &peer->hashPubKey);
684 if (NULL == to_remove) 678 if (NULL == to_remove)
@@ -1030,11 +1024,9 @@ select_peer (const GNUNET_HashCode * key,
1030 } 1024 }
1031 else 1025 else
1032 { 1026 {
1033#if DEBUG_DHT
1034 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1027 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1035 "Excluded peer `%s' due to BF match in greedy routing for %s\n", 1028 "Excluded peer `%s' due to BF match in greedy routing for %s\n",
1036 GNUNET_i2s (&pos->id), GNUNET_h2s (key)); 1029 GNUNET_i2s (&pos->id), GNUNET_h2s (key));
1037#endif
1038 GNUNET_STATISTICS_update (GDS_stats, 1030 GNUNET_STATISTICS_update (GDS_stats,
1039 gettext_noop 1031 gettext_noop
1040 ("# Peers excluded from routing due to Bloomfilter"), 1032 ("# Peers excluded from routing due to Bloomfilter"),
@@ -1067,11 +1059,9 @@ select_peer (const GNUNET_HashCode * key,
1067 gettext_noop 1059 gettext_noop
1068 ("# Peers excluded from routing due to Bloomfilter"), 1060 ("# Peers excluded from routing due to Bloomfilter"),
1069 1, GNUNET_NO); 1061 1, GNUNET_NO);
1070#if DEBUG_DHT
1071 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1062 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1072 "Excluded peer `%s' due to BF match in random routing for %s\n", 1063 "Excluded peer `%s' due to BF match in random routing for %s\n",
1073 GNUNET_i2s (&pos->id), GNUNET_h2s (key)); 1064 GNUNET_i2s (&pos->id), GNUNET_h2s (key));
1074#endif
1075 pos = pos->next; 1065 pos = pos->next;
1076 continue; /* Ignore bloomfiltered peers */ 1066 continue; /* Ignore bloomfiltered peers */
1077 } 1067 }
@@ -1154,12 +1144,10 @@ get_target_peers (const GNUNET_HashCode * key,
1154 &nxt->id.hashPubKey)); 1144 &nxt->id.hashPubKey));
1155 GNUNET_CONTAINER_bloomfilter_add (bloom, &rtargets[off]->id.hashPubKey); 1145 GNUNET_CONTAINER_bloomfilter_add (bloom, &rtargets[off]->id.hashPubKey);
1156 } 1146 }
1157#if DEBUG_DHT
1158 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1147 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1159 "Selected %u/%u peers at hop %u for %s (target was %u)\n", off, 1148 "Selected %u/%u peers at hop %u for %s (target was %u)\n", off,
1160 GNUNET_CONTAINER_multihashmap_size (all_known_peers), 1149 GNUNET_CONTAINER_multihashmap_size (all_known_peers),
1161 (unsigned int) hop_count, GNUNET_h2s (key), ret); 1150 (unsigned int) hop_count, GNUNET_h2s (key), ret);
1162#endif
1163 if (0 == off) 1151 if (0 == off)
1164 { 1152 {
1165 GNUNET_free (rtargets); 1153 GNUNET_free (rtargets);
@@ -1212,11 +1200,9 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type,
1212 struct GNUNET_PeerIdentity *pp; 1200 struct GNUNET_PeerIdentity *pp;
1213 1201
1214 GNUNET_assert (NULL != bf); 1202 GNUNET_assert (NULL != bf);
1215#if DEBUG_DHT
1216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1203 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1217 "Adding myself (%s) to PUT bloomfilter for %s\n", 1204 "Adding myself (%s) to PUT bloomfilter for %s\n",
1218 GNUNET_i2s (&my_identity), GNUNET_h2s (key)); 1205 GNUNET_i2s (&my_identity), GNUNET_h2s (key));
1219#endif
1220 GNUNET_CONTAINER_bloomfilter_add (bf, &my_identity.hashPubKey); 1206 GNUNET_CONTAINER_bloomfilter_add (bf, &my_identity.hashPubKey);
1221 GNUNET_STATISTICS_update (GDS_stats, gettext_noop ("# PUT requests routed"), 1207 GNUNET_STATISTICS_update (GDS_stats, gettext_noop ("# PUT requests routed"),
1222 1, GNUNET_NO); 1208 1, GNUNET_NO);
@@ -1225,12 +1211,10 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type,
1225 &targets); 1211 &targets);
1226 if (0 == target_count) 1212 if (0 == target_count)
1227 { 1213 {
1228#if DEBUG_DHT
1229 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1214 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1230 "Routing PUT for %s terminates after %u hops at %s\n", 1215 "Routing PUT for %s terminates after %u hops at %s\n",
1231 GNUNET_h2s (key), (unsigned int) hop_count, 1216 GNUNET_h2s (key), (unsigned int) hop_count,
1232 GNUNET_i2s (&my_identity)); 1217 GNUNET_i2s (&my_identity));
1233#endif
1234 return; 1218 return;
1235 } 1219 }
1236 msize = 1220 msize =
@@ -1254,11 +1238,9 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type,
1254 for (i = 0; i < target_count; i++) 1238 for (i = 0; i < target_count; i++)
1255 { 1239 {
1256 target = targets[i]; 1240 target = targets[i];
1257#if DEBUG_DHT
1258 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1241 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1259 "Routing PUT for %s after %u hops to %s\n", GNUNET_h2s (key), 1242 "Routing PUT for %s after %u hops to %s\n", GNUNET_h2s (key),
1260 (unsigned int) hop_count, GNUNET_i2s (&target->id)); 1243 (unsigned int) hop_count, GNUNET_i2s (&target->id));
1261#endif
1262 pending = GNUNET_malloc (sizeof (struct P2PPendingMessage) + msize); 1244 pending = GNUNET_malloc (sizeof (struct P2PPendingMessage) + msize);
1263 pending->importance = 0; /* FIXME */ 1245 pending->importance = 0; /* FIXME */
1264 pending->timeout = expiration_time; 1246 pending->timeout = expiration_time;
@@ -1335,20 +1317,16 @@ GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type,
1335 target_count = 1317 target_count =
1336 get_target_peers (key, peer_bf, hop_count, desired_replication_level, 1318 get_target_peers (key, peer_bf, hop_count, desired_replication_level,
1337 &targets); 1319 &targets);
1338#if DEBUG_DHT
1339 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1340 "Adding myself (%s) to GET bloomfilter for %s\n", 1321 "Adding myself (%s) to GET bloomfilter for %s\n",
1341 GNUNET_i2s (&my_identity), GNUNET_h2s (key)); 1322 GNUNET_i2s (&my_identity), GNUNET_h2s (key));
1342#endif
1343 GNUNET_CONTAINER_bloomfilter_add (peer_bf, &my_identity.hashPubKey); 1323 GNUNET_CONTAINER_bloomfilter_add (peer_bf, &my_identity.hashPubKey);
1344 if (0 == target_count) 1324 if (0 == target_count)
1345 { 1325 {
1346#if DEBUG_DHT
1347 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1326 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1348 "Routing GET for %s terminates after %u hops at %s\n", 1327 "Routing GET for %s terminates after %u hops at %s\n",
1349 GNUNET_h2s (key), (unsigned int) hop_count, 1328 GNUNET_h2s (key), (unsigned int) hop_count,
1350 GNUNET_i2s (&my_identity)); 1329 GNUNET_i2s (&my_identity));
1351#endif
1352 return; 1330 return;
1353 } 1331 }
1354 reply_bf_size = GNUNET_CONTAINER_bloomfilter_get_size (reply_bf); 1332 reply_bf_size = GNUNET_CONTAINER_bloomfilter_get_size (reply_bf);
@@ -1367,11 +1345,9 @@ GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type,
1367 for (i = 0; i < target_count; i++) 1345 for (i = 0; i < target_count; i++)
1368 { 1346 {
1369 target = targets[i]; 1347 target = targets[i];
1370#if DEBUG_DHT
1371 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1348 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1372 "Routing GET for %s after %u hops to %s\n", GNUNET_h2s (key), 1349 "Routing GET for %s after %u hops to %s\n", GNUNET_h2s (key),
1373 (unsigned int) hop_count, GNUNET_i2s (&target->id)); 1350 (unsigned int) hop_count, GNUNET_i2s (&target->id));
1374#endif
1375 pending = GNUNET_malloc (sizeof (struct P2PPendingMessage) + msize); 1351 pending = GNUNET_malloc (sizeof (struct P2PPendingMessage) + msize);
1376 pending->importance = 0; /* FIXME */ 1352 pending->importance = 0; /* FIXME */
1377 pending->timeout = GNUNET_TIME_relative_to_absolute (GET_TIMEOUT); 1353 pending->timeout = GNUNET_TIME_relative_to_absolute (GET_TIMEOUT);
@@ -1578,10 +1554,8 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
1578 /* cannot verify, good luck */ 1554 /* cannot verify, good luck */
1579 break; 1555 break;
1580 } 1556 }
1581#if DEBUG_DHT
1582 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "PUT for %s at %s\n", 1557 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "PUT for %s at %s\n",
1583 GNUNET_h2s (&put->key), GNUNET_i2s (&my_identity)); 1558 GNUNET_h2s (&put->key), GNUNET_i2s (&my_identity));
1584#endif
1585 bf = GNUNET_CONTAINER_bloomfilter_init (put->bloomfilter, DHT_BLOOM_SIZE, 1559 bf = GNUNET_CONTAINER_bloomfilter_init (put->bloomfilter, DHT_BLOOM_SIZE,
1586 GNUNET_CONSTANTS_BLOOMFILTER_K); 1560 GNUNET_CONSTANTS_BLOOMFILTER_K);
1587 GNUNET_break_op (GNUNET_YES == 1561 GNUNET_break_op (GNUNET_YES ==
@@ -1800,11 +1774,9 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
1800 /* remember request for routing replies */ 1774 /* remember request for routing replies */
1801 GDS_ROUTING_add (peer, type, options, &get->key, xquery, xquery_size, 1775 GDS_ROUTING_add (peer, type, options, &get->key, xquery, xquery_size,
1802 reply_bf, get->bf_mutator); 1776 reply_bf, get->bf_mutator);
1803#if DEBUG_DHT
1804 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "GET for %s at %s after %u hops\n", 1777 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "GET for %s at %s after %u hops\n",
1805 GNUNET_h2s (&get->key), GNUNET_i2s (&my_identity), 1778 GNUNET_h2s (&get->key), GNUNET_i2s (&my_identity),
1806 (unsigned int) ntohl (get->hop_count)); 1779 (unsigned int) ntohl (get->hop_count));
1807#endif
1808 /* local lookup (this may update the reply_bf) */ 1780 /* local lookup (this may update the reply_bf) */
1809 if ((0 != (options & GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) || 1781 if ((0 != (options & GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) ||
1810 (am_closest_peer (&get->key, peer_bf))) 1782 (am_closest_peer (&get->key, peer_bf)))