GNUNET_assert(test_find_peer->find_peer_context->outstanding > 0);
test_find_peer->find_peer_context->outstanding--;
test_find_peer->find_peer_context->total--;
- if ((0 == test_find_peer->find_peer_context->total) &&
- (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).rel_value > 60))
+ if (0 == test_find_peer->find_peer_context->total)
{
GNUNET_SCHEDULER_add_now(&count_new_peers, test_find_peer->find_peer_context);
}
if (dhtlog_handle != NULL)
dhtlog_handle->insert_round(DHT_ROUND_NORMAL, rounds_finished);
+ if (GNUNET_YES != malicious_after_settle)
+ {
+ GNUNET_SCHEDULER_add_now(&setup_malicious_peers, NULL);
+ }
+
if (GNUNET_YES == do_find_peer)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling find peer requests during \"settle\" time.\n");
if (malicious_completed == malicious_getters + malicious_putters + malicious_droppers)
{
- GNUNET_SCHEDULER_cancel(die_task);
- fprintf(stderr, "Finished setting all malicious peers up, calling continuation!\n");
- if (dhtlog_handle != NULL)
- GNUNET_SCHEDULER_add_now (&continue_puts_and_gets, NULL);
- else
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, settle_time),
- &continue_puts_and_gets, NULL);
+ fprintf(stderr, "Finished setting all malicious peers up!\n");
}
}
ctx->malicious_type = GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP;
GNUNET_SCHEDULER_add_now (&set_malicious, ctx);
}
-
- /**
- * If we have any malicious peers to set up,
- * the malicious callback should call continue_gets_and_puts
- */
- if (malicious_getters + malicious_putters + malicious_droppers > 0)
- {
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Giving malicious set tasks some time before starting testing!\n");
- die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, (malicious_getters + malicious_putters + malicious_droppers) * 2),
- &end_badly, "from set malicious");
- }
- else /* Otherwise, continue testing */
- {
- if (cls != NULL)
- {
- GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Scheduling continue_puts_and_gets now!\n");
- GNUNET_SCHEDULER_add_now (&continue_puts_and_gets, NULL);
- }
- }
}
/**
if ((dhtlog_handle != NULL) && (settle_time > 0))
{
topo_ctx = GNUNET_malloc(sizeof(struct TopologyIteratorContext));
- if (GNUNET_YES == malicious_after_settle) /* Don't set malicious peers until after settle_time */
- topo_ctx->cont = &continue_puts_and_gets;
- else /* Set malicious peers now */
- topo_ctx->cont = &setup_malicious_peers;
+ topo_ctx->cont = &continue_puts_and_gets;
topo_ctx->peers_seen = GNUNET_CONTAINER_multihashmap_create(num_peers);
- topo_ctx->cls = &continue_puts_and_gets;
GNUNET_SCHEDULER_add_now(&capture_current_topology, topo_ctx);
}
- else
- {
- GNUNET_SCHEDULER_add_now(&setup_malicious_peers, &continue_puts_and_gets);
- }
}
else if (total_connections + failed_connections == expected_connections)
{
argv, "gnunet-dht-driver", "nohelp",
options, &run, &ok);
+
if (ret != GNUNET_OK)
{
GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "`gnunet-dht-driver': Failed with error code %d\n", ret);