aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-01-14 12:04:01 +0000
committerNathan S. Evans <evans@in.tum.de>2011-01-14 12:04:01 +0000
commite265bc76b9cca9b6e0a4fbc69e6a0cb1ff30649f (patch)
treebdfb5959de3842cfc808ecdec609e6a00566c331
parent96915ca174eb43bd10e9f87f46f0f4bb64259470 (diff)
downloadgnunet-e265bc76b9cca9b6e0a4fbc69e6a0cb1ff30649f.tar.gz
gnunet-e265bc76b9cca9b6e0a4fbc69e6a0cb1ff30649f.zip
unknown issue
-rw-r--r--src/dht/gnunet-dht-driver.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c
index 94e039833..07dbd6f2e 100644
--- a/src/dht/gnunet-dht-driver.c
+++ b/src/dht/gnunet-dht-driver.c
@@ -885,6 +885,7 @@ log_topology_cb (void *cls,
885 const char *emsg) 885 const char *emsg)
886{ 886{
887 struct TopologyIteratorContext *topo_ctx = cls; 887 struct TopologyIteratorContext *topo_ctx = cls;
888 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "log_topology_cb\n");
888 if ((first != NULL) && (second != NULL)) 889 if ((first != NULL) && (second != NULL))
889 { 890 {
890 /* GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "According to CORE, peer %s is connected to %s\n", GNUNET_i2s(first), GNUNET_h2s(&second->hashPubKey));*/ 891 /* GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "According to CORE, peer %s is connected to %s\n", GNUNET_i2s(first), GNUNET_h2s(&second->hashPubKey));*/
@@ -1039,6 +1040,7 @@ capture_current_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext *
1039{ 1040{
1040 struct TopologyIteratorContext *topo_ctx = cls; 1041 struct TopologyIteratorContext *topo_ctx = cls;
1041 dhtlog_handle->insert_topology(0); 1042 dhtlog_handle->insert_topology(0);
1043 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Called capture_current_topology\n");
1042 GNUNET_TESTING_get_topology (pg, &log_topology_cb, topo_ctx); 1044 GNUNET_TESTING_get_topology (pg, &log_topology_cb, topo_ctx);
1043} 1045}
1044 1046
@@ -2019,7 +2021,10 @@ count_peers_cb (void *cls,
2019 2021
2020#if HAVE_MALICIOUS 2022#if HAVE_MALICIOUS
2021 if (GNUNET_YES == malicious_after_settle) 2023 if (GNUNET_YES == malicious_after_settle)
2024 {
2025 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "calling setup_malicious_peers\n");
2022 GNUNET_SCHEDULER_add_now(&setup_malicious_peers, NULL); 2026 GNUNET_SCHEDULER_add_now(&setup_malicious_peers, NULL);
2027 }
2023#endif 2028#endif
2024 } 2029 }
2025 } 2030 }
@@ -2125,6 +2130,7 @@ setup_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc)
2125 int remember[num_puts][num_peers]; 2130 int remember[num_puts][num_peers];
2126 memset(&remember, 0, sizeof(int) * num_puts * num_peers); 2131 memset(&remember, 0, sizeof(int) * num_puts * num_peers);
2127#endif 2132#endif
2133 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "in setup_puts_and_gets\n");
2128 known_keys = GNUNET_malloc(sizeof(GNUNET_HashCode) * num_puts); 2134 known_keys = GNUNET_malloc(sizeof(GNUNET_HashCode) * num_puts);
2129 for (i = 0; i < num_puts; i++) 2135 for (i = 0; i < num_puts; i++)
2130 { 2136 {
@@ -2188,6 +2194,7 @@ continue_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext * t
2188 int max; 2194 int max;
2189 struct TopologyIteratorContext *topo_ctx; 2195 struct TopologyIteratorContext *topo_ctx;
2190 struct FindPeerContext *find_peer_context; 2196 struct FindPeerContext *find_peer_context;
2197 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "In continue_puts_and_gets, dhtlog_handle %s\n", dhtlog_handle);
2191 if (dhtlog_handle != NULL) 2198 if (dhtlog_handle != NULL)
2192 { 2199 {
2193 if (settle_time >= 180 * 2) 2200 if (settle_time >= 180 * 2)
@@ -2206,6 +2213,7 @@ continue_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext * t
2206 topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext)); 2213 topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext));
2207 topo_ctx->cont = &setup_puts_and_gets; 2214 topo_ctx->cont = &setup_puts_and_gets;
2208 topo_ctx->peers_seen = GNUNET_CONTAINER_multihashmap_create(num_peers); 2215 topo_ctx->peers_seen = GNUNET_CONTAINER_multihashmap_create(num_peers);
2216 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "setting setup_puts_and_gets for %d seconds in the future\n", settle_time + 90);
2209 GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, (settle_time + 90)), &capture_current_topology, topo_ctx); 2217 GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, (settle_time + 90)), &capture_current_topology, topo_ctx);
2210 } 2218 }
2211 else 2219 else
@@ -2338,6 +2346,7 @@ choose_next_malicious (struct GNUNET_TESTING_PeerGroup *pg, struct GNUNET_CONTAI
2338 struct GNUNET_TESTING_Daemon *temp_daemon; 2346 struct GNUNET_TESTING_Daemon *temp_daemon;
2339 2347
2340 curr_distance = 0; 2348 curr_distance = 0;
2349 GNUNET_assert (bloom != NULL);
2341 2350
2342 if (GNUNET_YES == malicious_sybil) 2351 if (GNUNET_YES == malicious_sybil)
2343 { 2352 {
@@ -2345,7 +2354,7 @@ choose_next_malicious (struct GNUNET_TESTING_PeerGroup *pg, struct GNUNET_CONTAI
2345 { 2354 {
2346 temp_daemon = GNUNET_TESTING_daemon_get(pg, i); 2355 temp_daemon = GNUNET_TESTING_daemon_get(pg, i);
2347 /* Check if this peer matches the bloomfilter */ 2356 /* Check if this peer matches the bloomfilter */
2348 if (GNUNET_YES == GNUNET_CONTAINER_bloomfilter_test (bloom, &temp_daemon->id.hashPubKey)) 2357 if ((GNUNET_NO == GNUNET_TESTING_daemon_running(temp_daemon)) || (GNUNET_YES == GNUNET_CONTAINER_bloomfilter_test (bloom, &temp_daemon->id.hashPubKey)))
2349 continue; 2358 continue;
2350 2359
2351 bits_match = GNUNET_CRYPTO_hash_matching_bits (&temp_daemon->id.hashPubKey, &sybil_target); 2360 bits_match = GNUNET_CRYPTO_hash_matching_bits (&temp_daemon->id.hashPubKey, &sybil_target);
@@ -2480,10 +2489,13 @@ topology_callback (void *cls,
2480 if ((dhtlog_handle != NULL) && (settle_time > 0)) 2489 if ((dhtlog_handle != NULL) && (settle_time > 0))
2481 { 2490 {
2482 topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext)); 2491 topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext));
2492 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Setting continue gets and puts as topo_cont\n");
2483 topo_ctx->cont = &continue_puts_and_gets; 2493 topo_ctx->cont = &continue_puts_and_gets;
2484 topo_ctx->peers_seen = GNUNET_CONTAINER_multihashmap_create(num_peers); 2494 topo_ctx->peers_seen = GNUNET_CONTAINER_multihashmap_create(num_peers);
2485 GNUNET_SCHEDULER_add_now(&capture_current_topology, topo_ctx); 2495 GNUNET_SCHEDULER_add_now(&capture_current_topology, topo_ctx);
2486 } 2496 }
2497 else
2498 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "For some reason, NOT scheduling final topology capture (settle_time %d, dhtlog_handle %s)!\n", settle_time, dhtlog_handle);
2487 } 2499 }
2488 else if (total_connections + failed_connections == expected_connections) 2500 else if (total_connections + failed_connections == expected_connections)
2489 { 2501 {
@@ -3009,11 +3021,8 @@ run (void *cls,
3009 malicious_sybil = GNUNET_YES; 3021 malicious_sybil = GNUNET_YES;
3010 } 3022 }
3011 3023
3012 if ((malicious_droppers > 0) || (malicious_getters > 0) || (malicious_putters > 0)) 3024 /* Create the bloomfilter for choosing which peers to set malicious */
3013 { 3025 malicious_bloom = GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, DHT_BLOOM_K);
3014 /* Create the bloomfilter for choosing which peers to set malicious */
3015 malicious_bloom = GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, DHT_BLOOM_K);
3016 }
3017 3026
3018 /* The normal behavior of the DHT is to do find peer requests 3027 /* The normal behavior of the DHT is to do find peer requests
3019 * on its own. Only if this is explicitly turned off should 3028 * on its own. Only if this is explicitly turned off should